a
    GGb                  
   @   s   d dl Z d dlZd dlZd dlZd dlmZ d dl	m
Z
 ejdd Zejdd Zejdd Zejjd	d
g dfdg dfgd
dgddd Zdd Zdd Zejdddejdejjdddgdd Zdd ZdS )     N)FloatingArrayc                   C   s:   t jddgd tjg ddgd  tjg ddg ddS )NTF   ,   booleanZdtype)pdarraynpnan r   r   Jlib/python3.9/site-packages/pandas/tests/arrays/boolean/test_arithmetic.pydata   s    .r   c                   C   s(   t jdgd dgd  d gd  ddS )NT   Fr   r   r   r   r   r   r   r   
left_array   s    r   c                   C   s   t jg dd ddS )N)TFNr   r   r   r   r   r   r   r   right_array   s    r   zopname, expadd)	TTNTFNNNNmul)	TFNFFNNNN)Zidsc                 C   s2   t t|}|| |}tj|dd}t|| d S )Nr   r   )getattroperatorr   r   tmassert_extension_array_equal)r   r   opnameZexpopresultexpectedr   r   r   test_add_mul!   s    	

r   c                 C   s>   d}t jt|d | |  W d    n1 s00    Y  d S )Nznumpy boolean subtract, the `-` operator, is (?:deprecated|not supported), use the bitwise_xor, the `\^` operator, or the logical_xor function instead\.match)pytestraises	TypeError)r   r   msgr   r   r   test_sub0   s    r#   c                 C   sV   | | }t tjdtjtjdtjtjtjtjtjg	ddtg d}t|| d S )Ng      ?g        Zfloat64r   )	FFTFFTTTT)r   r	   r   infr
   r   r   )r   r   r   r   r   r   r   test_div9   s    "r%   r   floordivmodpowz#TODO follow int8 behaviour? GH34686)reason)Zmarksc                 C   s:   t t|}|| |}|| d|d}t|| d S )NZInt8)r   r   Zastyper   r   )r   r   r   r   r   r   r   r   r   test_op_int8E   s    

r*   c                 C   s   |}t | }t||}d}tjt|d |d W d    n1 sH0    Y  d}tjt|d |t d W d    n1 s0    Y  |dvrd}tjt|d$ |t jd|jd W d    n1 s0    Y  d S )	Nzdid not contain a loop with signature matching types|BooleanArray cannot perform the operation|not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''r   Zfooz]unsupported operand type\(s\) for|Concatenation operation is not implemented for NumPy arraysZ20180101)__mul____rmul__zounsupported operand type\(s\) for|can only concatenate str|not all arguments converted during string formatting)index)r   ZSeriesr   r   r    r!   Z	Timestampr-   )r   Zall_arithmetic_operatorsr   sopsr"   r   r   r   test_error_invalid_valuesZ   s     

&,r0   )r   Znumpyr	   r   Zpandasr   Zpandas._testingZ_testingr   Zpandas.arraysr   Zfixturer   r   r   ZmarkZparametrizer   r#   r%   ZparamZxfailr*   r0   r   r   r   r   <module>   s@   





	

