
    Pi                     <    d dl Zd dlZd dlmZ  G d d          ZdS )    N)TimedeltaArrayc                   &    e Zd Zd Zd Zd Zd ZdS )TestTimedeltaArrayConstructorc                     d}t          j        t          |          5  t          j        t          j        g dd                     d d d            d S # 1 swxY w Y   d S )Nz3dtype bool cannot be converted to timedelta64\[ns\]match         booldtype)pytestraises	TypeErrorr   _from_sequencenparrayselfmsgs     /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/tests/arrays/timedeltas/test_constructors.pytest_other_type_raisesz4TestTimedeltaArrayConstructor.test_other_type_raises   s    D]9C000 	M 	M)"(999F*K*K*KLLL	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	Ms   +AAAc                 >   d}t          j        t          |          5  t          j        t          j        g dd          d           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          j        t          j        g dd          t          j        d                     d d d            n# 1 swxY w Y   d	}t          j        t          |          5  t          j        t          j        g dd          t          j        d
                     d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          j        t          j        g dd          d           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          j        t          j        g dd          t          j        d                     d d d            d S # 1 swxY w Y   d S )Nz;dtype 'category' is invalid, should be np.timedelta64 dtyper   r	   i8r   categoryz8dtype 'int64' is invalid, should be np.timedelta64 dtypeint64zCdtype 'datetime64\[ns\]' is invalid, should be np.timedelta64 dtypezM8[ns]zHdtype 'datetime64\[us, UTC\]' is invalid, should be np.timedelta64 dtypezM8[us, UTC]z;Supported timedelta64 resolutions are 's', 'ms', 'us', 'ns'zm8[Y])r   r   
ValueErrorr   r   r   r   r   r   s     r   test_incorrect_dtype_raisesz9TestTimedeltaArrayConstructor.test_incorrect_dtype_raises   se   K]:S111 	 	)$///z   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	
 I]:S111 	 	)$///rx7H7H   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	
 U]:S111 	 	)$///rx7I7I   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 X 	 ]:S111 	 	)$///}   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	
 L]:S111 	 	)$///rx7H7H   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	sY   -AAA??C

CC2?D==EE%-FF"%F"?HHHc                     t          j        g dd          }t          j        |d          }|j        |u sJ t          j        |d          }|j        |usJ |j        j        |usJ d S )Nr	   zm8[ns]r   F)copyT)r   r   r   r   _ndarraybase)r   dataarrs      r   	test_copyz'TestTimedeltaArrayConstructor.test_copy.   s    x			222+Du===|t####+Dt<<<|4''''| ,,,,,,    c                     d}t          j        t          |          5  t          j        g t
                     d d d            d S # 1 swxY w Y   d S )Nz9dtype 'object' is invalid, should be np.timedelta64 dtyper   r   )r   r   r   r   r   objectr   s     r   test_from_sequence_dtypez6TestTimedeltaArrayConstructor.test_from_sequence_dtype7   s    I]:S111 	< 	<)"F;;;;	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<s   AAAN)__name__
__module____qualname__r   r    r'   r+    r(   r   r   r      sT        M M M
  B- - -< < < < <r(   r   )numpyr   r   pandas.core.arraysr   r   r/   r(   r   <module>r2      s^         - - - - - -3< 3< 3< 3< 3< 3< 3< 3< 3< 3<r(   