a
    Pf                     @   s   d dl Z d dlZd dlZd dl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g ddd Zdd ZdS )    Nc                   C   s:   t jddgd tjg ddgd  tjg ddg ddS )>Fixture returning boolean array with valid and missing values.TF   ,   booleanZdtype)pdarraynpnan r   r   d/var/www/ai-form-bot/venv/lib/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 )r   T   FNr   r   r   r   r   r   r   r   
left_array   s    r   c                   C   s   t jg dd ddS )r   )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   opname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_sub2   s    r%   c                 C   s   d}t jt|d( t| jt|j  W d    n1 s@0    Y  t jt|d | |  W d    n1 sv0    Y  d S )N-operator '.*' not implemented for bool dtypesr   )r    r!   NotImplementedErrorr   Series_datar#   r   r   r   test_div;   s
    6r*   r   )floordivmodpowc                 C   s   t t|}|dkrRd}tjt|d || |}W d    n1 sD0    Y  d S || |}|| d|d}t|| d S )Nr,   r&   r   ZInt8)r   r   r    r!   r'   Zastyper   r   )r   r   r   r   r$   r   r   r   r   r   test_op_int8E   s    	
(
r.   c           	      C   s  |rdd l }t|jjtf}nt}|}t| }t||}d}tj	t|d |d W d    n1 sh0    Y  d
g d}tj	||d |td W d    n1 s0    Y  |dvrd
g d	}tj	||d$ |tjd|jd
 W d    n1 s0    Y  d S )Nr   zdid 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foo|)!unsupported operand type\(s\) forz;Concatenation operation is not implemented for NumPy arrayshas no kernelZ20180101)__mul____rmul__)r0   zcan only concatenate strz4not all arguments converted during string formattingr1   znot implemented)index)Zpyarrowr"   libZArrowNotImplementedErrorr'   r   r(   r   r    r!   join	Timestampr4   )	r   Zall_arithmetic_operatorsZusing_infer_stringpaerrr   sopsr$   r   r   r   test_error_invalid_values]   s,    

&,
	r<   )r   numpyr	   r    Zpandasr   Zpandas._testingZ_testingr   Zfixturer   r   r   markZparametrizer   r%   r*   r.   r<   r   r   r   r   <module>   s4   


	


	

