
    A>iM                     x    S r SSKrSSKrSSKJrJrJrJr  SSK	J
r  SSKJrJr  S
S jrSS jrSS\4S jjrS	 rg)z)
Assertion helpers for arithmetic tests.
    N)	DataFrameIndexSeriesarray)BooleanArrayNumpyExtensionArrayc                     [         R                  " [        US9   X-     SSS5        [         R                  " [        US9   X-     SSS5        g! , (       d  f       N5= f! , (       d  f       g= f)z
Helper function to assert that two objects cannot be added.

Parameters
----------
left : object
    The first operand.
right : object
    The second operand.
msg : str, default "cannot add"
    The error message expected in the TypeError.
matchNpytestraises	TypeErrorleftrightmsgs      ]/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pandas/tests/arithmetic/common.pyassert_cannot_addr      sG     
y	, 
-	y	, 
-	, 
-	,	,	,s   A A
A
A-c                    [         R                  " [        US9   X-     SSS5        [         R                  " [        US9   X-     SSS5        [         R                  " [        US9   X-
    SSS5        [         R                  " [        US9   X-
    SSS5        g! , (       d  f       N= f! , (       d  f       Nl= f! , (       d  f       NW= f! , (       d  f       g= f)a  
Helper function to assert that two objects can
neither be added nor subtracted.

Parameters
----------
left : object
    The first operand.
right : object
    The second operand.
msg : str or None, default None
    The error message expected in the TypeError.
r
   Nr   r   s      r   assert_invalid_addsub_typer   (   s     
y	, 
-	y	, 
-	y	, 
-	y	, 
-	, 
-	,	,	,	,	,	,	,s/   B B+&B<C
B(+
B9<
C

Cis_cmpc                    [        U [        5      (       d  [        U[        5      (       a  [        $ [        U [        5      (       d  [        U[        5      (       a2  U(       a%  [        U [        5      (       a  [        R
                  $ [        $ [        U [        5      (       d  [        U[        5      (       a  U(       a  [        R
                  $ [        $ [        R                  $ )z
Get the box to use for 'expected' in an arithmetic or comparison operation.

Parameters
left : Any
right : Any
is_cmp : bool, default False
    Whether the operation is a comparison method.
)
isinstancer   r   r   npr   tmto_array)r   r   r   s      r   get_upcast_boxr   @   s     $	""j	&B&B$:eV#<#<ju--88O$*UE":":88O;;    c                 j   U[         [        4;  a  UO[        R                  nS nU" X:H  5      nU" [        R                  " UR                  [        R
                  S95      n[        R                  " XV5        U" X:H  5      n[        R                  " XS" U5      5        U" X:g  5      n[        R                  " XV) 5        U" X:g  5      n[        R                  " XS" U) 5      5        SR                  / SQ5      n[        R                  " [        US9   X:    SSS5        [        R                  " [        US9   X:*    SSS5        [        R                  " [        US9   X:    SSS5        [        R                  " [        US9   X:    SSS5        [        R                  " [        US9   X:    SSS5        [        R                  " [        US9   X:*    SSS5        [        R                  " [        US9   X:    SSS5        [        R                  " [        US9   X:    SSS5        g! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g= f)z
Assert that comparison operations with mismatched types behave correctly.

Parameters
----------
left : np.ndarray, ExtensionArray, Index, or Series
right : object
box : {pd.DataFrame, pd.Series, pd.Index, pd.array, tm.to_array}
c                     [        U [        5      (       a  U R                  $ [        U [        5      (       a  U R	                  [
        5      $ U $ N)r   r   _ndarrayr   astypebool)xs    r   xbox2(assert_invalid_comparison.<locals>.xbox2h   s<     a,--::a&&88D>!r   )dtype|)zInvalid comparison betweenzCannot compare typeznot supported betweenzinvalid type promotionzThe DTypes <class 'numpy.dtype\[datetime64\]'> and <class 'numpy.dtype\[int64\]'> do not have a common DType. For example they cannot be stored in a single array unless the dtype is `object`.r
   N)r   r   r   zerosshapebool_r   assert_equaljoinr   r   r   )r   r   boxxboxr'   resultexpectedr   s           r   assert_invalid_comparisonr4   Y   s    eU^+3D 4=!FBHHV\\:;HOOF%5=!FOOFDN+4=!FOOFI&5=!FOOFD(O,
((	
C 
y	, 
-	y	, 
-	y	, 
-	y	, 
-	y	, 
-	y	, 
-	y	, 
-	y	, 
-	, 
-	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,s`   H+9H=II +I1J7JJ$+
H:=
I
I 
I.1
I?
J
J!$
J2)z
cannot addr"   )F)__doc__numpyr   r   pandasr   r   r   r   pandas._testing_testingr   pandas.core.arraysr   r   r   r   r%   r   r4    r   r   <module>r<      sB       &0 2Er   