
    PiJ                     h   d dl Z d dlmZmZmZmZ d dlZd dlZd dlmZm	Z	m
Z
 d dlZd dlZd dlmZ d dlmZ d dlmZmZ d dlmZmZmZmZmZ d dlmZ  G d d	          Z G d
 d          Z G d d          Z  G d d          Z! G d d          Z" G d d          Z#d Z$ej%        &                    dddg          d             Z'd Z(ej%        &                    dddg          d             Z)d Z*ej%        &                    ddej+         ej,        d           eeg          d!             Z-dS )"    N)datedatetime	timedeltatimezone)gettztzoffsettzutc)NpyDatetimeUnit)PY314)OutOfBoundsDatetimePandas4Warning)NANaTPeriod	Timedelta	Timestampc                      e Zd Zej                            deeg          d             Zej                            deeg          d             Z	d Z
ej                            ddi gddd	igd
ddigdddigddddgdddddgddddgddddgdd	ddgddddgdd	ddgdd	d dgddddgd!ddddgddddgd"dd#dgg          d$             Zd%S )&#TestTimestampConstructorUnitKeywordtypc                      |d          }t          |d          }t          d          }||k    sJ t          |d          }t          d          }||k    sJ d S )N   Yunitz
2120-01-01Mz
1982-07-01r   )selfr   valtsexpecteds        /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/tests/scalar/timestamp/test_constructors.py'test_constructor_int_float_with_YM_unitzKTestTimestampConstructorUnitKeyword.test_constructor_int_float_with_YM_unit%   sm     c#hhs%%%\**X~~~~s%%%\**X~~~~~~    c                      |d          }dt          |           d}t          j        t          |          5  t	          |d           d d d            d S # 1 swxY w Y   d S )Nl    `n1! zcannot convert input z with the unit 'D'matchDr   )intpytestraisesr   r   )r   r   r   msgs       r!   ;test_construct_from_int_float_with_unit_out_of_bound_raisesz_TestTimestampConstructorUnitKeyword.test_construct_from_int_float_with_unit_out_of_bound_raises2   s     c/""Bc#hhBBB].c::: 	% 	%c$$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%s   AA Ac                    d}t          j        t          |          5  t          dd           d d d            n# 1 swxY w Y   t          j        t          |          5  t          dd           d d d            d S # 1 swxY w Y   d S )Nz9Conversion of non-round float with unit=[MY] is ambiguousr%   g     b@r   r   r   r)   r*   
ValueErrorr   r   r+   s     r!   4test_constructor_float_not_round_with_YM_unit_raiseszXTestTimestampConstructorUnitKeyword.test_constructor_float_not_round_with_YM_unit_raises;   s    J]:S111 	' 	'e#&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' ]:S111 	' 	'e#&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	's!   <A A "BBBzvalue, check_kwargsl    Bm@ig jr
Cr   usg  `kBmsg  6Asi*  r'   r   )r   hgb6Ai  i  )r   r2   nsg  6Ai  )r   r2   g `kBi  gyr
Cg W`kBg(jr
C   g@s
Ci  g) `kBg    f@   c                      dd} ||fi | d S )N   r   c                 T   t          | |          }|j        dk    sJ |j        dk    sJ |j        dk    sJ |j        |k    sJ |dk    r(|j        dk    sJ |j        |k    sJ |j        |k    sJ n'|j        dk    sJ |j        dk    sJ |j        dk    sJ |j        |k    sJ d S )Nr     r:   r'   r   )	r   yearmonthdayhourminutesecondmicrosecond
nanosecond)valuer   r5   r4   r2   r6   stamps          r!   checkzKTestTimestampConstructorUnitKeyword.test_construct_with_unit.<locals>.checka   s    e$///E:%%%%;!####9>>>>:????s{{|q((((|q(((((B.....|q((((|q(((((A----#r))))))r#   )Nr:   r:   r   r    )r   rE   check_kwargsrG   s       r!   test_construct_with_unitz<TestTimestampConstructorUnitKeyword.test_construct_with_unitE   s6    8	* 	* 	* 	*  	e$$|$$$$$r#   N)__name__
__module____qualname__r)   markparametrizer(   floatr"   r,   r1   rJ   rH   r#   r!   r   r   $   s       [US%L11
 
 21
 [US%L11% % 21%' ' ' [$&7+fd^</&#?Sq))*:Cs33
 >F++ 5t36O6OP1D3L3LM7$f9U9UV,t1.E.EF/$d1K1KL1D3L3LM3d!ST5U5UV4s&6Q6QR3R001-	
 6% %7 6% % %r#   r   c                       e Zd Zd Zd Zej                            dddg          ej                            ddd ej	        dd	          d
 e
dddddddej                  g          d                         Zej                            dddg          ej                            dddg          d                         Zej                            dd ej        d          g          ej                            ddddd e
dddddddd          df e
dddddddd          dfg          d                         Zej                            ddg          ej                            dddg          d                          ZdS )!#TestTimestampConstructorFoldKeywordc                     d}t          j        t          |          5  t          dd           d d d            d S # 1 swxY w Y   d S )Nz5Valid values for the fold argument are None, 0, or 1.r%   {      foldr.   r0   s     r!   -test_timestamp_constructor_invalid_fold_raisezQTestTimestampConstructorFoldKeyword.test_timestamp_constructor_invalid_fold_raiseu   s     F]:S111 	# 	#c""""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#   =AAc                    t          j        d          }d}|                    d          }t          j        t          |          5  t          t          ddddd	dd          |d
           d d d            d S # 1 swxY w Y   d S )NpytzzBpytz timezones do not support fold. Please use dateutil timezones.Europe/Londonr%     
      r      tzrW   )r)   importorskipr   r*   r/   r   r   )r   r[   r+   rb   s       r!   *test_timestamp_constructor_pytz_fold_raisezNTestTimestampConstructorFoldKeyword.test_timestamp_constructor_pytz_fold_raise|   s     "6**R]]?++]:S111 	J 	JhtRQAq99bqIIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	Js   &A::A>A>rW   r   r:   ts_input    P7-f. gP[YѵCr6   2019-10-27 01:30:00+01:00r]   r^   r_   r`   tzinfoc                     d}t          j        t          |          5  t          ||           d d d            d S # 1 swxY w Y   d S )NzCannot pass fold with possibly unambiguous input: int, float, numpy.datetime64, str, or timezone-aware datetime-like. Pass naive datetime-like or build Timestamp from components.r%   )re   rW   r.   )r   re   rW   r+   s       r!   (test_timestamp_constructor_fold_conflictzLTestTimestampConstructorFoldKeyword.test_timestamp_constructor_fold_conflict   s    K 	
 ]:S111 	4 	4xd3333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4rY   rb   dateutil/Europe/LondonNc           	      T    t          ddddd||          }|j        }|}||k    sJ d S )Nr]   r^   r_   r:   r`   )r=   r>   r?   r@   rA   rb   rW   r   rW   )r   rb   rW   r   resultr    s         r!   &test_timestamp_constructor_retain_foldzJTestTimestampConstructorFoldKeyword.test_timestamp_constructor_retain_fold   sD    
 D2"SWXXX!!!!!!r#   r\   zts_input,fold_out)rf   r   )l    pFs. r:   )rg   r   )z2019-10-27 01:30:00+00:00r:   rV   c                 J    t          ||          }|j        }|}||k    sJ d S )Nrb   rn   )r   rb   re   fold_outr   ro   r    s          r!   0test_timestamp_constructor_infer_fold_from_valuezTTestTimestampConstructorFoldKeyword.test_timestamp_constructor_infer_fold_from_value   s9    , xB'''!!!!!!r#   zfold,value_out)r   l    RzweW, )r:   l    v$iW, c                 r    t          ddddd          }t          |||          }|j        }|}||k    sJ d S )Nr]   r^   r_   r:   r`   ra   )r   r   _value)r   rb   rW   	value_outre   r   ro   r    s           r!   0test_timestamp_constructor_adjust_value_for_foldzTTestTimestampConstructorFoldKeyword.test_timestamp_constructor_adjust_value_for_fold   sP     D"b!R00xBT222!!!!!!r#   )rK   rL   rM   rX   rd   r)   rN   rO   np
datetime64r   r   utcrk   rp   zoneinfoZoneInfort   rx   rH   r#   r!   rR   rR   t   sD       # # #J J J [VaV,,[!BM-t44'HT2r1b!Qx|DDD	
	 		4 	4	 	 -,	4 [T$<d#CDD[VaV,," " -, ED" [$Ho..	
  [$$,,XdBAr1aa888!<XdBAr1aa888!<	

 
" "
 
 $" [T$<#=>>[!!	
 " "  ?>" " "r#   rR   c                      e Zd Zd Zd Zej                            dg d          d             Zej                            di ddidd	d
g          d             Z	d Z
ej                            dg d          d             ZdS )3TestTimestampConstructorPositionalAndKeywordSupportc                    d}t          j        t          |          5  t          dd           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          ddd           d d d            n# 1 swxY w Y   t          j        t          |          5  t          ddd           d d d            n# 1 swxY w Y   t
          rd}nd	}t          j        t          |          5  t          ddd           d d d            n# 1 swxY w Y   t          j        t          |          5  t          ddd
           d d d            n# 1 swxY w Y   t          t          ddd                    t          t          d                    k    sJ t          t          ddddddd                    t          t          d                    k    sJ d S )Nz5'NoneType' object cannot be interpreted as an integerr%   r<   r:   month must be in 1..12r      /must be in range 1..31 for month 1 in year 2000day is out of range for month         r8   20151112rU      ?B 2015-11-12 01:02:03.999999r)   r*   	TypeErrorr   r/   r   reprr0   s     r!   test_constructor_positionalzOTestTimestampConstructorPositionalAndKeywordSupport.test_constructor_positional   s   E]9C000 	 	dA	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ']:S111 	" 	"dAq!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"]:S111 	# 	#dB"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#  	2CCC1C]:S111 	" 	"dAq!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"]:S111 	# 	#dAr"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# IdB++,,Yz5J5J0K0KKKKKIdBAq!V<<==233B
 B
 
 
 
 
 
 
sU   ;??#BBB'CC	C	7DDD;EE Ec                    d}t          j        t          |          5  t          dd           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          ddd           d d d            n# 1 swxY w Y   t          j        t          |          5  t          dd	d           d d d            n# 1 swxY w Y   t
          rd
}nd}t          j        t          |          5  t          ddd           d d d            n# 1 swxY w Y   t          j        t          |          5  t          ddd           d d d            n# 1 swxY w Y   t          t          ddd                    t          t          d                    k    sJ t          t          ddddddd                    t          t          d                    k    sJ d S )Nz@function missing required argument 'day'|Required argument 'day'r%   r<   r:   r=   r>   r   r   )r=   r>   r?   r   r   r   r   r   r   r8   r   rU   r   r   )r=   r>   r?   r@   rA   rB   rC   r   r   r0   s     r!   test_constructor_keywordzLTestTimestampConstructorPositionalAndKeywordSupport.test_constructor_keyword   sP   P]9C000 	* 	*4q))))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* ']:S111 	1 	14qa0000	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1]:S111 	2 	24rq1111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2  	2CCC1C]:S111 	1 	14qa0000	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1]:S111 	2 	24qb1111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 I4rr:::;;tj!!@
 @
 
 
 
 
 "  

 

 )899::
; 
; 
; 
; 
; 
;sW   <A A $BB
B)CCC:DD D?EE"%E"argr=   r>   r?   r@   rA   rB   rC   rD   c                     |di}d}t          j        t          |          5  t          di | d d d            d S # 1 swxY w Y   d S )Nr:   z-Cannot pass a date attribute keyword argumentr%   2010-10-10 12:59:59.999999999)r   r.   )r   r   kwargr+   s       r!   )test_invalid_date_kwarg_with_string_inputz]TestTimestampConstructorPositionalAndKeywordSupport.test_invalid_date_kwarg_with_string_input  s     a=]:S111 	@ 	@?????	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@s   <A A kwargsr=     r:   r   c                     d}d}d                     ||g          }t          j        t          |          5  t	          di | d d d            d S # 1 swxY w Y   d S )NzCfunction missing required argument '(year|month|day)' \(pos [123]\)z<Required argument '(year|month|day)' \(pos [123]\) not found|r%   rH   )joinr)   r*   r   r   )r   r   msg1msg2r+   s        r!    test_constructor_missing_keywordzTTestTimestampConstructorPositionalAndKeywordSupport.test_constructor_missing_keyword(  s    
 VNhhd|$$]9C000 	  	 	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 s   AAAc                     t          dddt          j                  }t          dt          j                  }||k    sJ d S )Nr   r8      rh   
2020-12-31)r   r   r{   )r   r   r    s      r!   'test_constructor_positional_with_tzinfoz[TestTimestampConstructorPositionalAndKeywordSupport.test_constructor_positional_with_tzinfo4  s?    tRHL999\(,???X~~~~~~r#   kwd)rD   rC   rB   rA   c                 &   |dk    r5t           j                            d          }|                    |           |di}t	          ddt
          j        i|}|dz   di}t          d
i |}t	          dt
          j        	          |z   }||k    sJ d S )NrD   zGH#45307)reason   )r   r8   r   ri   r4   r   rr   rH   )r)   rN   xfailapplymarkerr   r   r{   r   )	r   r   requestrN   r   r   	td_kwargstdr    s	            r!   5test_constructor_positional_keyword_mixed_with_tzinfoziTestTimestampConstructorPositionalAndKeywordSupport.test_constructor_positional_keyword_mixed_with_tzinfo:  s     ,;$$J$77D%%%qCCHLCFCC3YN	####\hl;;;b@X~~~~~~r#   N)rK   rL   rM   r   r   r)   rN   rO   r   r   r   r   rH   r#   r!   r   r      s        
 
 
6#; #; #;J [		
 		
 		
 @ @ @ [XVTNTTU<V<V'WXX	  	  YX	    [U$U$U$UVV  WV  r#   r   c                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	$TestTimestampClassMethodConstructorsc                     d}t          j        t          |          5  t          j                     d d d            d S # 1 swxY w Y   d S )NzTimestamp.utcnow is deprecatedr%   )tmassert_produces_warningr   r   utcnowr0   s     r!   test_utcnow_deprecatedz;TestTimestampClassMethodConstructors.test_utcnow_deprecatedO  s    .'cBBB 	 		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   ?AAc                     d}t          j        t          |          5  t          j        d           d d d            d S # 1 swxY w Y   d S )Nz(Timestamp.utcfromtimestamp is deprecatedr%   +   )r   r   r   r   utcfromtimestampr0   s     r!    test_utcfromtimestamp_deprecatedzETestTimestampClassMethodConstructors.test_utcfromtimestamp_deprecatedU  s    8'cBBB 	+ 	+&r***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+s   A  AAc                     d}d}d}t          j        t          |          5  t          j        ||           d d d            d S # 1 swxY w Y   d S )Nz%Y%m%d-%H%M%S-%f%zz20190129-235348-000001+0000z)Timestamp.strptime\(\) is not implementedr%   )r)   r*   NotImplementedErrorr   strptime)r   fmtr   r+   s       r!   test_constructor_strptimez>TestTimestampClassMethodConstructors.test_constructor_strptime[  s     #*:].c::: 	( 	(r3'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(s   AA	A	c                     t          d          }t          j        ddd          }t          j        ddd          }||k    sJ ||k    sJ t          |t                     sJ d S )Nz2000-01-03 00:00:00r<   r:   )r   r   fromisocalendar
isinstance)r   expected_timestampexpected_stdlibro   s       r!    test_constructor_fromisocalendarzETestTimestampClassMethodConstructors.test_constructor_fromisocalendard  sx    &'<=="24A>>*4A66+++++((((&),,,,,,,r#   c                 &   t          ddd          }t          j        |                                          }||k    sJ |                                |                                k    sJ t          j        |                                d          }t          dd          |k    sJ |                                |                                k    sJ t          dddd	d	          }t          j        |                                          }|                                |k    sJ t          d
d          }|                                }t          j        |                                d          }|                                |k    sJ d S )Nr<   r:   
US/Easternrr   z
2000-01-01i  r      r   z	2011-4-16)r   r   fromordinal	toordinalto_pydatetime)r   baser   dtrF   dt_tzs         r!   test_constructor_fromordinalzATestTimestampClassMethodConstructors.test_constructor_fromordinalm  sp   a##"4>>#3#344rzzzz~~2<<>>1111"4>>#3#3EEE,7772====~~2<<>>1111 dAr1a(("2<<>>22!!R'''' +,777##%%"5??#4#4FFF!!U******r#   c                    t          d          }t          j                    }t          j                    }t          dd          }t          j        d          }t          d          }t	          ||z
            |k     sJ t	          ||z
            |k     sJ t	          ||z
            |k     sJ t	          |                    d           |                    d           z
            |k     sJ d S )Nnowr   rr   r:   seconds)r   r   r   r   abstz_localizer   ts_from_stringts_from_methodts_datetimets_from_string_tzts_from_method_tzdeltas          r!   test_nowz-TestTimestampClassMethodConstructors.test_now  s   "5))"lnn%e===%M\::: !$$$>N233e;;;;;/0058888$'8899EAAAA!--d33#//556  	     r#   c                    t          d          }t          j                    }t          j                    }t          dd          }t          j        d          }t          d          }t	          ||z
            |k     sJ t	          ||z
            |k     sJ t	          ||z
            |k     sJ t	          |                    d           |                    d           z
            |k     sJ d S )Ntodayr   rr   r:   r   )r   r   r   r   r   r   r   s          r!   
test_todayz/TestTimestampClassMethodConstructors.test_today  s   "7++"**n&&%g,???%O|<<< !$$$>N233e;;;;;/0058888$'8899EAAAA!--d33#//556  	     r#   N)
rK   rL   rM   r   r   r   r   r   r   r   rH   r#   r!   r   r   L  s}          + + +( ( (- - -+ + +,
 
 
.
 
 
 
 
r#   r   c                   f    e Zd Zd Zd Zej                            dddg          d             ZdS ) TestTimestampResolutionInferencec                 >    t          d          }|j        dk    sJ d S )Nz01:01:01.111r2   r   r   r   r   s     r!   test_construct_from_time_unitz>TestTimestampResolutionInference.test_construct_from_time_unit  s"    ~&&w$r#   c                    t          d          }|j        dk    sJ t          d          }|j        dk    sJ t          d          }|j        dk    sJ t          d          }|j        dk    sJ t          d          }|j        dk    sJ t          d          }|j        dk    sJ t          d          }|j        d	k    sJ t          d
          }|j        dk    sJ t          d          }|t          d          k    sJ |j        d	k    sJ t          d          }|j        dk    sJ t          d          }|j        dk    sJ d S )Nz
01/30/2023r2   2015Q1z2016-01-01 1:30:01 PMz2016 June 3 15:25:01.345z	300-01-01z300 June 1:30:01.300z"01-01-2013T00:00:00.000000000+0000r6   z2016/01/02 03:04:05.001000 UTCz%01-01-2013T00:00:00.000000002100+0000z"01-01-2013T00:00:00.000000002+0000z2020-01-01 00:00+00:00z2020-01-01 00+00:00r   r   s     r!   test_constructor_str_infer_resoz@TestTimestampResolutionInference.test_constructor_str_infer_reso  sh    |$$w$ x  w$ .//w$122w${##w$-..w$ ;<<w$788w$ >??YCDDDDDDw$ /00w$,--w$r#   methodr   r   c                      t          t          |                      }t          |          }|j        |j        cxk    rdk    sn J d S )Nr2   )getattrr   r   )r   r   r   r   s       r!   test_now_today_unitz4TestTimestampResolutionInference.test_now_today_unit  sY     4F3355"6**"n&9AAAATAAAAAAAAr#   N)	rK   rL   rM   r   r   r)   rN   rO   r   rH   r#   r!   r   r     sk          
) ) )V [Xw'788B B 98B B Br#   r   c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zej                            d e eddddddd          d           edddddddd           eddddddddd	  	         eddddddddd	  	         edddddddej        d	  	        g          d             Zej                            dddg          d             Zd Zd  Zd! Zd" Zd# Zej                            d$d%d&g          d'             Zd( Zd) Zej                            d*d+d,g          d-             Zej                            d$d.d/g          d0             Z ej                            d1eeg          d2             Z!d3 Z"d4 Z#d5 Z$d6 Z%d7 Z&ej                            d8d9 e'd:          d:d;g          d<             Z(d= Z)dS )>TestTimestampConstructorsc                     t          j        dd          }d}t          j        t          |          5  t          |           d d d            d S # 1 swxY w Y   d S )Nr:   500mz8np.datetime64 objects with units containing a multiplierr%   )ry   rz   r)   r*   r/   r   )r   dt64r+   s      r!   "test_disallow_dt64_with_weird_unitz<TestTimestampConstructors.test_disallow_dt64_with_weird_unit  s    }Q''H]:S111 	 	dOOO	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   AAAc                     d}t          j        t          |          5  t          d           d d d            d S # 1 swxY w Y   d S )NzFParsing datetimes with weekday but no day information is not supportedr%   z2023 Sept Thur.   r0   s     r!   test_weekday_but_no_day_raisesz8TestTimestampConstructors.test_weekday_but_no_day_raises  s    V]:S111 	' 	'o&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	'   ;??c                     t          j        t          d          5  t          d           d d d            d S # 1 swxY w Y   d S )Nzgives an invalid tzoffsetr%   z200622-12-31r.   r   s    r!   )test_construct_from_string_invalid_raiseszCTestTimestampConstructors.test_construct_from_string_invalid_raises  s     ]:-HIII 	& 	&n%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s   9= =c                     t          d          }|j        dk    sJ t          d          }|j        dk    sJ t          d          }|j        dk    sJ t          d          }|j        dk    sJ d S )Nz2016-01-01 04:05:06-01:00r2   z2016-01-01 04:05:06.000-01:00z 2016-01-01 04:05:06.000000-01:00z#2016-01-01 04:05:06.000000001-01:00r6   r   r   s     r!   2test_constructor_from_iso8601_str_with_offset_resozLTestTimestampConstructors.test_constructor_from_iso8601_str_with_offset_reso  sz    233w$677w$9::w$<==w$r#   c                 `    t          ddd          }t          |          }|j        dk    sJ d S )N  	   r:   r4   )r   r   r   )r   objr   s      r!   &test_constructor_from_date_second_resoz@TestTimestampConstructors.test_constructor_from_date_second_reso  s3     4As^^w#~~~~~~r#   c                     t          j        d          }d}t          ||          }t          |                              |          }||k    sJ |j        dk    sJ d S )Nz1970-01-01 05:00:00z	UTC+05:00rr   r7   )ry   rz   r   r   r@   )r   r   tzstrr   alts        r!   #test_constructor_datetime64_with_tzz=TestTimestampConstructors.test_constructor_datetime64_with_tz  sd    ]011 re$$$mm''..Syyyyw!||||||r#   c                    d}t          dddd          }d}t          j        |                                          dz  |k    sJ |||fdt          dddd	          |d
z   fdt          ddddddd          |dz   fdt	          d          |dz   fg}ddt
          j        dfdddt          t          d                    dft          j	        
                    d d          dfg}|D ]\  }}}t	          |          t	          |          fD ]f}	|	                    d          }	|	                    d          j        |k    sJ t	          |	          }	|	                    d          j        |k    sJ g|D ]\  }
}t	          ||
          t	          ||
          fD ]}	|	                    d          }	||dz  dz  z
  }|	                    d          j        |k    sJ t	          |	          }	|	                    d          j        |k    sJ |
#t	          |	                              d          }	nt	          |	d          }	||dz  dz  z
  }|	                    d          j        |k    sJ ӌd S )Nz2014-07-01 09:00     r:   r        t  ʚ;z2014-07-01 10:00r^        qaz2014-07-01 09:00:00.000008000r      @  z2014-07-01 09:00:00.000000005r7   )Nr   UTCr   
Asia/Tokyor   r   zdateutil/US/PacificihoursPF  r6   rr   i  r  )r   calendartimegm	timetupler   r   r{   r   dateutilrb   r   as_unitrv   
tz_convert)r   base_strbase_dtbase_expectedtests	timezonesdate_strdate_objr    ro   rb   offsetexpected_tzexpected_utcs                 r!   test_constructorz*TestTimestampConstructors.test_constructor$  s   %4Aq))1 w002233mC}TTTT w."q!R(( 44 0q!Q1a00$ 09::!
( \1'ib)))**B/[!!$..2	
	 -2 	G 	G(Hh$X..	(0C0CD ? ?--~~d++2h>>>> #6**~~d++2h>>>>> ( G G
F(b9999XRT;U;U;UV G GF#^^ F #+Vd]]-J"JK!>>$//6+EEEE 'v..F!>>$//6+EEEE ~!*6!2!2!=!=e!D!D!*6e!<!<!<#+ftmm.K#KL!>>$//6,FFFFF#GG	G 	Gr#   c           
         d}t          dddd          }d}t          j        |                                          dz  |k    sJ ||fd|d	z   fd
|dz   fd|dz   fg}dt          j        dfdddt	          t          d                    dft          j        	                    d d          dfg}|D ]\  }}t          |          fD ]Q}|                    d          j        |k    sJ t          |          }|                    d          j        |k    sJ R|D ]\  }	}
t          ||	          }|}|                    d          j        |k    sJ t          |          }|                    d          j        |k    sJ t          |                              d          }|}|                    d          j        |k    sJ t          dd          }|j        t          d          j        k    sJ d}t          |          |k    sJ |t          t          |                    k    sJ t          dd          }|j        t          d          j        k    sJ d}t          |          |k    sJ |t          t          |                    k    sJ t          dd           }|j        t          d!          j        k    sJ d"}t          |          |k    sJ |t          t          |                    k    sJ t          d#d$          }|j        t          d!          j        k    sJ d%}t          |          |k    sJ |t          t          |                    k    sJ d S )&Nz2014-07-01 11:00:00+02:00r  r  r:   r   r  r  z2014-07-01 12:00:00+02:00r	  z#2014-07-01 11:00:00.000008000+02:00r  z#2014-07-01 11:00:00.000000005+02:00r7   r  r   r  r  r  r  r  r  r6   rr   r  z2013-11-01 00:00:00-0500zAmerica/Chicagoz2013-11-01 05:00z;Timestamp('2013-11-01 00:00:00-0500', tz='America/Chicago')r  z6Timestamp('2013-11-01 14:00:00+0900', tz='Asia/Tokyo')z2015-11-18 15:45:00+05:45zAsia/Katmanduz2015-11-18 10:00z9Timestamp('2015-11-18 15:45:00+0545', tz='Asia/Katmandu')z2015-11-18 15:30:00+05:30Asia/Kolkataz8Timestamp('2015-11-18 15:30:00+0530', tz='Asia/Kolkata'))r   r  r  r  r   r{   r   r  rb   r   r   r  rv   r  r   eval)r   r  r  r  r   r!  r"  r    ro   rb   r$  r%  r&  s                r!   "test_constructor_with_stringoffsetz<TestTimestampConstructors.test_constructor_with_stringoffseti  s   .4Aq))1 w002233mC}TTTT }%(-:N*NO2MD4HI2MA4EF	
 \1'ib)))**B/[!!$..2
	 #( 	C 	CHh$X../ ? ?~~d++2h>>>> #6**~~d++2h>>>>> ( C C
F"8333&~~d++2kAAAA #6**~~d++2kAAAA #6**55e<<'~~d++2lBBBBBC  5:KLLL}	*< = = DDDDDPF||x''''d6ll++++++ 5,GGG}	*< = = DDDDDKF||x''''d6ll++++++
 6?KKK}	*< = = DDDDDNF||x''''d6ll++++++ 6>JJJ}	*< = = DDDDDMF||x''''d6ll++++++++r#   c                 L   d}t          j        t          |          5  t          t	          d                     d d d            n# 1 swxY w Y   d}t          j        t
          |          5  t          t          d                     d d d            d S # 1 swxY w Y   d S )NzCannot convert inputr%   rU   zCannot convert Periodz
1000-01-01)r)   r*   r   r   slicer/   r   r0   s     r!   test_constructor_invalidz2TestTimestampConstructors.test_constructor_invalid  s   $]9C000 	  	 eAhh	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 %]:S111 	, 	,f\**+++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,s#   AAA/BB Bc                    d}t          j        t          |          5  t          dd           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          dt
          j        d           d d d            n# 1 swxY w Y   d	}t          j        t          |          5  t          d
d           d d d            d S # 1 swxY w Y   d S )NzJArgument 'tzinfo' has incorrect type \(expected datetime.tzinfo, got str\)r%   z
2017-10-22r   rh   zat most one ofr  ri   rb   zHCannot pass a date attribute keyword argument when passing a date stringz
2012-01-01
US/Pacific)r)   r*   r   r   r/   r   r{   r0   s     r!   test_constructor_invalid_tzz5TestTimestampConstructors.test_constructor_invalid_tz  s   5 	 ]9C000 	9 	9l<8888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 ]:S111 	C 	Cl8<EBBBB	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C Y]:S111 	2 	2 lL111		2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2s3   <A A $BBB5CCCc                    t          dddd          t          dddt          j                  t          dddt          j                  t          t          ddd          t          j                  t          t          ddd          d          t          t          ddd          t          j                  gt	          fd	D                       sJ d S )
Ni  r^      r  )r=   r>   r?   rb   r=   r>   r?   ri   rh   rr   c              3   0   K   | ]}|d          k    V  dS )r   NrH   ).0r   stampss     r!   	<genexpr>zJTestTimestampConstructors.test_constructor_tz_or_tzinfo.<locals>.<genexpr>  s+      44r2?444444r#   )r   r   r{   r   all)r   r8  s    @r!   test_constructor_tz_or_tzinfoz7TestTimestampConstructors.test_constructor_tz_or_tzinfo  s     4rre<<<4rr(,GGG4rrhlCCChtR,,X\BBBhtR,,777htR,,>>>
 4444V4444444444r#   ro   r<   r:   rU   r   r   r7      )rD   r   r  )	r=   r>   r?   r@   rA   rB   rC   rD   rb   N)rb   rD   c                     t          t          ddddddd          |j                  }|t          d	          z   }||k    sJ d S )
Nr<   r:   rU   r   r   r7   r<  rr   )nanoseconds)r   r   rb   r   r   ro   r    s      r!   test_constructor_nanosecondz5TestTimestampConstructors.test_constructor_nanosecond  sY    @ XdAq!Q1==&)LLLiA6666!!!!!!r#   zZ0Z00c                     d| }t          j        t          |          5  t          d|            d d d            d S # 1 swxY w Y   d S )NzAUnknown datetime string format, unable to parse: 2014-11-02 01:00r%   z2014-11-02 01:00r.   )r   rA  r+   s      r!   %test_constructor_invalid_Z0_isostringz?TestTimestampConstructors.test_constructor_invalid_Z0_isostring  s     VRSUU]:S111 	. 	.,,,---	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	.s   AAAc                    t          t          j        j        dz            }t	          j        t          |          5  t          t          j        j        dz             d d d            n# 1 swxY w Y   t          t          j        j        dz            }t	          j        t          |          5  t          t          j        j        dz             d d d            d S # 1 swxY w Y   d S )NrU   r%   )strr   maxrv   r)   r*   r   minr0   s     r!    test_out_of_bounds_integer_valuez:TestTimestampConstructors.test_out_of_bounds_integer_value  sE   )-&*++].c::: 	0 	0im*Q.///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0)-&*++].c::: 	0 	0im*Q.///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s#   "A++A/2A/2"C!!C%(C%c                 R   t          j        d                              d          }t          j        t          j                                      d          |z   }t          j        t          j                                      d          }t	          |           t	          |           t          j        j	        }t	          ||z
            j
        |k    sJ t	          ||z             j
        |k    sJ t          j        dd          }t          j        dd          }d}t          j        t          |          5  t	          |           d d d            n# 1 swxY w Y   t          j        t          |          5  t	          |           d d d            d S # 1 swxY w Y   d S )	Nr:   ztimedelta64[us]zM8[us]z-292277022657-01-27T08:29mz292277026596-12-04T15:31zOut of boundsr%   )ry   timedelta64astyperz   r   rI  rH  r
   	NPY_FR_usrE   _cresor)   r*   r/   )r   one_us	min_ts_us	max_ts_usus_valtoo_lowtoo_highr+   s           r!   test_out_of_bounds_valuez2TestTimestampConstructors.test_out_of_bounds_value  s   ""))*;<< M)-0077AAFJ	M)-0077AA	 	)) !*0V+,,3v====V+,,3v==== - ;SAA=!;SAA]:S111 	 	g	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ]:S111 	  	 h	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 s$   =EE E?FF #F c                    d}t          j        t          |          5  t          d                              d           d d d            n# 1 swxY w Y   t          j        t          |          5  t          d                              d           d d d            n# 1 swxY w Y   t          d          }|j        dk    sJ t          d          }|j        dk    sJ d S )Nz,Cannot cast .* to unit='ns' without overflowr%   z
1676-01-01r6   z
2263-01-01r2   )r)   r*   r/   r   r  r   )r   r+   r   s      r!   test_out_of_bounds_stringz3TestTimestampConstructors.test_out_of_bounds_string9  sQ   <]:S111 	2 	2l##++D111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2]:S111 	2 	2l##++D111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 |$$w$|$$w$s#   #AAA3#B""B&)B&c                     d}t          j        t          |          5  t          d           d d d            d S # 1 swxY w Y   d S )Nz7Out of bounds nanosecond timestamp: 2262-04-11 23:47:16r%   z2262-04-11 23:47:16.854775808)r)   r*   r   r   r0   s     r!   test_barely_out_of_boundsz3TestTimestampConstructors.test_barely_out_of_boundsF  s     H].c::: 	7 	75666	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7r   c                 l   d}d}|D ]l}|D ]g}t          j        ||          }t          |          }|dv r!|j        |                    d          k    sJ K|j        t          j        j        k    sJ hmt          j	        t           j
                  }d}|j        dz   |j        fD ]^}	dD ]Y}t          j        |	|          }t          j        t          |          5  t          |           d d d            n# 1 swxY w Y   Z_d	}
|
D ]+}|D ]&}t          j        ||          }t          |           ',d S )
N)z
1677-09-21z
2262-04-12)r'   r5   rL  r4   r3   r2   )r4   r3   r2   i8zOut of bounds second timestamp:r:   )r'   r5   rL  r%   )z
1677-09-23z
2262-04-11)ry   rz   r   rv   viewrP  r
   NPY_FR_srE   iinfoint64rI  rH  r)   r*   r   )r   out_of_bounds_dates
time_unitsdate_stringr   r   r   infor+   rE   in_bounds_datess              r!    test_bounds_with_different_unitsz:TestTimestampConstructors.test_bounds_with_different_unitsN  s   :5
. 		G 		GK" G G}[$77t__,,,9		$77777 9(@(FFFFFFG x!!/hlDH- 	$ 	$E' $ $}UD11]#6cBBB $ $dOOO$ $ $ $ $ $ $ $ $ $ $ $ $ $ $$
 7* 	  	 K"    }[$77$ 	  	 s   C77C;>C;r   z	001-01-01z
0001-01-01c                 :   d}t          j        t          |          5  t          |                              d           d d d            n# 1 swxY w Y   t          |          }|j        dk    sJ |j        |j        cxk    r|j        cxk    rdk    sn J d S )Nz=Cannot cast 0001-01-01 00:00:00 to unit='ns' without overflowr%   r6   r2   r:   )	r)   r*   r   r   r  r   r=   r>   r?   )r   r   r+   r   s       r!   %test_out_of_bounds_string_consistencyz?TestTimestampConstructors.test_out_of_bounds_string_consistencyn  s     N].c::: 	) 	)cNN""4(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) s^^w$w"(1111bf111111111111s   #AAAc                 8    t          t           j                   d S N)r   rI  r   s    r!   test_min_validz(TestTimestampConstructors.test_min_validy      )-     r#   c                 8    t          t           j                   d S rk  )r   rH  r   s    r!   test_max_validz(TestTimestampConstructors.test_max_valid}  rm  r#   r$  z+0300z+0200c                     t          d| d          }t          |                              d          }||k    sJ d S )Nz2016-10-30 03:00:00zEurope/Helsinkirr   )r   r  )r   r$  r    ro   s       r!   !test_construct_timestamp_near_dstz;TestTimestampConstructors.test_construct_timestamp_near_dst  sS     ;6;;@QRRR8$$//0ABB!!!!!!r#   z2013/01/01 00:00:00+09:00z2013-01-01 00:00:00+09:00c                     t          |          }t          t          ddd          t          t          d                              }||k    sJ d S )Ni  r:   r   r  rr   )r   r   r   r   )r   r   ro   r    s       r!   +test_construct_with_different_string_formatzETestTimestampConstructors.test_construct_with_different_string_format  sW    
 3XdAq11hyq?Q?Q?Q6R6RSSS!!!!!!r#   boxc                 ~   dddt           j        d}d}t          j        t          |          5  t           |d	i |d           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t           |d	i |t          j        d                     d d d            d S # 1 swxY w Y   d S )
N  r:   r5  z#Cannot pass a datetime or Timestampr%   r1  rr   rh   rH   )r   r{   r)   r*   r/   r   r|   r}   )r   rt  r   r+   s       r!   *test_raise_tz_and_tzinfo_in_datetime_inputzDTestTimestampConstructors.test_raise_tz_and_tzinfo_in_datetime_input  sa    1MM3]:S111 	6 	6ccmmFmm5555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	63]:S111 	M 	MccmmFmmH,=l,K,KL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;*B22B69B6c                     t          t          ddd          t                                }t          t          ddd                                        t                                }||k    sJ d S )Nrv  r:   rr   )r   r   r	   r   r?  s      r!   -test_dont_convert_dateutil_utc_to_default_utczGTestTimestampConstructors.test_dont_convert_dateutil_utc_to_default_utc  sf    8D!Q//EGG<<<XdAq1122>>uwwGG!!!!!!r#   c                      G d dt                     } |ddd          }t          |          }t          ddd          }||k    sJ d S )Nc                       e Zd ZdS )STestTimestampConstructors.test_constructor_subclassed_datetime.<locals>.SubDatetimeN)rK   rL   rM   rH   r#   r!   SubDatetimer|    s        Dr#   r}  r<   r:   )r   r   )r   r}  dataro   r    s        r!   $test_constructor_subclassed_datetimez>TestTimestampConstructors.test_constructor_subclassed_datetime  st    	 	 	 	 	( 	 	 	 {4A&&4T1a((!!!!!!r#   c                     t          dd          }|j        t          j        u sJ |j        dk    sJ t          d                              d          }|j        dk    sJ d S )Nz3/11/2012 05:00r{   rr   r7   )r   ri   r   r{   r@   r   )r   	utc_stamps     r!   !test_timestamp_constructor_tz_utcz;TestTimestampConstructors.test_timestamp_constructor_tz_utc  ss    /E:::	8<////~""""/00<<UCC	~""""""r#   c                     t          d d          }t          d|          }t          |                                          }||k    sJ d S )Ni   z3/11/2012 04:00rr   )r   r   r   )r   ri   r    ro   s       r!   #test_timestamp_to_datetime_tzoffsetz=TestTimestampConstructors.test_timestamp_to_datetime_tzoffset  sT    $%%.6:::81133446!!!!!!r#   c                    dD ]}t          d|          }t          d                              |          }||k    sJ d}t          j        t          |          5  t          d|           d d d            n# 1 swxY w Y   t          dd          }t          d                              d          }||k    sJ d	}t          j        t          |          5  t          d	d           d d d            n# 1 swxY w Y   t          d
          }|                    d                              d          }t          dd          }||k    sJ t          dd          }t          dd          }||k    sJ t          dd          }t          dd          }||k    sJ d	}t          j        t          |          5  t          d	d           d d d            n# 1 swxY w Y   t          dd          }t          |                    d          j                  }|                    d                              d          }||k    sJ t          dd          }t          dd          }||k    sJ d S )N)zEurope/BrusselszEurope/Praguez2015-10-25 01:00rr   z.Cannot infer dst time from 2015-10-25 02:00:00r%   z2015-10-25 02:00z2017-03-26 01:00zEurope/Parisz2017-03-26 02:00z2015-11-18 10:00:00r  r)  z2015-11-18 15:30:00+0530z2017-03-26 00:00z2017-03-26 00:00:00+0100z2017-03-26 01:00:00+0100z2017-03-26 02:00:00+0100r6   z2017-03-26 03:00z2017-03-26 03:00:00+0200)r   r   r)   r*   r/   r  r  rv   )r   rb   ro   r    r+   naives         r!   ,test_timestamp_constructor_near_dst_boundaryzFTestTimestampConstructors.test_timestamp_constructor_near_dst_boundary  s   
 7 	5 	5B1b999F !344@@DDHX%%%%BCz555 5 5,44445 5 5 5 5 5 5 5 5 5 5 5 5 5 5 -.AAA/00<<^LL!!!! ]:S111 	= 	=(^<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= /00""5))44^DD7NKKK!!!! -.AAA7NKKK!!!!-.AAA7NKKK!!!! ]:S111 	= 	=(^<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 5.III&....566$$U++66~FF!!!!-.AAA7NKKK!!!!!!s6   A;;A?	A?	C==DD	G''G+.G+rb   zpytz/US/Easternr   zdateutil/US/Easternc                 h   t          |t                    rQ|                    d          r<t          j        d          }|                    |                    d                    }t          t          ddd          |          }t          d|          }|j	        |j	        k    sJ ||k    sJ d S )Nzpytz/r[   r   r   r   rr   z	3/11/2012)
r   rG  
startswithr)   rc   r   removeprefixr   r   r@   )r   rb   r[   ro   r    s        r!   )test_timestamp_constructed_by_date_and_tzzCTestTimestampConstructors.test_timestamp_constructed_by_date_and_tz  s     b# 	92==#9#9 	9&v..Drw7788B4a,,444[R000{hm++++!!!!!!r#   c           	         d}t          j        t          |          5  t          t	          dddt
          j                  d            d d d            n# 1 swxY w Y   t          j        t          |          5  t          dt
          j        d            d d d            n# 1 swxY w Y   t          j        t          |          5  t          d	d            d d d            d S # 1 swxY w Y   d S )
Nz:Passed data is timezone-aware, incompatible with 'tz=None'r%     r:   rh   rr   z2022-01-01 00:00:00r0  z2022-01-01 00:00:00-0400)r)   r*   r/   r   r   r   r{   r0   s     r!   test_explicit_tz_nonez/TestTimestampConstructors.test_explicit_tz_none  s   J]:S111 	J 	JhtQ(,???DIIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J ]:S111 	K 	K+HLTJJJJ	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K ]:S111 	; 	;0T::::	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	;s5   -AAA=B&&B*-B*C++C/2C/)*rK   rL   rM   r   r   r   r   r   r  r'  r+  r.  r2  r;  r)   rN   rO   r   r   r   r{   r@  rE  rJ  rW  rY  r[  rg  ri  rl  ro  rq  rs  rw  ry  r  r  r  r  r   r  r  rH   r#   r!   r   r     s         ' ' '& & &      CG CG CGJQ, Q, Q,f, , ,2 2 2(
5 
5 
5 [IhhtQ1aA661EEEI	 	 	 I
 
 
 IdAq!Q1dqAAAIdAq!Q1!LLL1	
 :" "; :" [S4-00. . 10.0 0 0     B  7 7 7     @ [U[,$?@@2 2 A@2! ! !! ! ! [X'9::" " ;:" [+-HI " " " [UXy$9::M M ;:M" " "

" 
" 
"# # #" " "0" 0" 0"d [E,!		
 
" 
" 
"
; 
; 
; 
; 
;r#   r   c                  n    t          dd          } | j        }t          |           j        }||k    sJ d S )Nl     !F rl   rr   )r   rv   )r   r    ro   s      r!   test_constructor_ambiguous_dstr    sD    
 
&+C	D	D	DByHr]]!FXr#   epochl   ?2\BT, l   ?2\BT, c                     t          | d          }|j                            |          }t          d          }t          |          j        | k    sJ ||k    sJ d S )Nzdateutil/America/Los_Angelesrr   r   r   )r   rb   dstr   rv   )r  r   ro   r    s       r!   "test_constructor_before_dst_switchr    si     
5;	<	<	<BUYYr]]F###HR==5((((Xr#   c                  N    t          d          } t          |           }|| u sJ d S )Nz2017-01-01T12r   )r    ro   s     r!   #test_timestamp_constructor_identityr  '  s3    ))Hx  FXr#   nanoi  c                     t          j        t          d          5  t          ddd|            d d d            d S # 1 swxY w Y   d S )Nznanosecond must be in 0..999r%   r  r:   )r=   r>   r?   rD   r.   )r  s    r!   test_timestamp_nano_ranger  .  s     
z)G	H	H	H > >t1!====> > > > > > > > > > > > > > > > > >s   =AAc                     d} t          j        t          |           5  t          dd          j        }d d d            n# 1 swxY w Y   |dk    sJ d} t          d          }|j        d	k    sJ t          j        t          |           5  |j         d d d            n# 1 swxY w Y   |j	        
                    d
          }|dk    sJ d S )Nz$The 'unit' keyword is only used whenr%   z
1800-01-01r4   r   l  'pS zCannot convert Timestamp to nanoseconds without overflow. Use `.asm8.view\('i8'\)` to cast represent Timestamp in its own unit \(here, us\).$z
0300-01-01r2   r]  l  ~i)r   r   UserWarningr   rE   r   r)   r*   OverflowErrorasm8r^  )r+   ro   r   s      r!   test_non_nano_valuer  5  sa   
0C		#Ks	;	;	; 9 9<c22289 9 9 9 9 9 9 9 9 9 9 9 9 9 9 )))))	# 
 
<	 	 B7d????	}C	0	0	0  
               W\\$F,,,,,,,s#   AAAB!!B%(B%na_valuer   c                 >    t          |           }t          }||u sJ d S rk  )r   r   )r  ro   r    s      r!   #test_timestamp_constructor_na_valuer  L  s-     x  FHXr#   ).r  r   r   r   r   r|   dateutil.tzr  r   r   r	   numpyry   r)   pandas._libs.tslibs.dtypesr
   pandas.compatr   pandas.errorsr   r   pandasr   r   r   r   r   pandas._testing_testingr   r   rR   r   r   r   r   r  rN   rO   r  r  r  r  nanrz   r  rH   r#   r!   <module>r     s]                            
      6 6 6 6 6 6             
                   M% M% M% M% M% M% M% M%`]" ]" ]" ]" ]" ]" ]" ]"@u u u u u u u upb
 b
 b
 b
 b
 b
 b
 b
J6B 6B 6B 6B 6B 6B 6B 6Brb; b; b; b; b; b; b; b;J   #68K"LMM	 	 NM	   "d,,> > -,>- - -. dBFMBM%4H4H#r%RSS  TS  r#   