
    m*i(@                       S r SSKrSSKJr  SSKJrJrJrJr  SSKJ	r	  SSK
r
SSKJr  SSKJr  SSKrSSKrSSKrSSKJr  SS	KJrJr  SS
KJr  SSKJrJr  SSKJs  Jr   SSK!J"r"  SSK#r$SSK#J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-  SSK.J/r0  SSK1J2r2  SSK3J4r5  SSK6J7r7  Sr8\(       a  Sr9Sr:OSr9Sr:\Rv                  Ry                  S5      r=\R|                  " SS/S9S 5       r? " S S5      r@ " S S5      rA " S S 5      rB " S! S"5      rC " S# S$5      rD " S% S&5      rE " S' S(5      rF " S) S*5      rG " S+ S,5      rH\R|                  " / S-QS9S. 5       rI\R|                  S/ 5       rJ\R|                  S0 5       rK\R|                  " / S1QS9S2 5       rL\R|                  S3 5       rM " S4 S55      rN " S6 S75      rOS8 rP\Rv                  R                  S9\R                  \S/5      S: 5       rT\Rv                  R                  S;/ S<Q5      \Rv                  R                  S=/ S>QS?4/ S@QSA4/SBSC/SD9SE 5       5       rUSF rV\Rv                  R                  SGSS/5      SH 5       rW\Rv                  R                  SISJ\7\7SK-   \7SL-   /5      SM 5       rXSN rYSO rZSP r[\Rv                  R                  SQSS/5      \Rv                  R                  SRSCSS/5      ST 5       5       r\SU r]\Rv                  R                  SVSW\&" SX\(/5      4SY\'" SZS[/S\S]94/5      S^ 5       r^S_ r_S` r`Sa raSb rbSc rcSd rdSere\*" \e5      rf\Rv                  Ry                  Sf5      \Rv                  R                  Sg\e\*" \e5      /Sh SD9\Rv                  R                  Si\eSSj \fR                  S5      \fR                  5       \fR                  \fR                  \j" \fR                  5      /Sk SD9\Rv                  R                  SlSS/5      Sm 5       5       5       5       rkg)nztest to_datetime     N)deque)datedatetime	timedeltatimezone)Decimal)parse)tzoffset)tslib)iNaTparsing)PY314)OutOfBoundsDatetimeOutOfBoundsTimedelta)is_datetime64_ns_dtype)		DataFrameDatetimeIndexIndexNaTSeries	Timestamp
date_rangeisnato_datetime)DatetimeArray)	datetimes)start_caching_ata_  You might want to try:\n    - passing `format` if your strings have a consistent format;\n    - passing `format=\'ISO8601\'` if your strings are all ISO8601 but not necessarily in exactly the same format;\n    - passing `format=\'mixed\'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.z, not 99zXday \d{1,2} must be in range 1\.\.\d{1,2} for month \d{1,2} in year \d{4}, at position 0 z,day is out of range for month, at position 0z2ignore:errors='ignore' is deprecated:FutureWarningTF)paramsc                     U R                   $ )z'
cache keyword to pass to to_datetime.
paramrequests    c/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/pandas/tests/tools/test_to_datetime.pycacher&   M   s    
 ==    c                      \ rS rSr\R
                  R                  SSS/5      S 5       r\R
                  R                  SS\" S5      \" S	5      \" S
5      //S\" S5      \" S5      \" S5      ///5      S 5       r	\R
                  R                  S/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/5      S 5       r
S rS rS rS rS rS r\R
                  R                  S/ SQSS \R$                  /SS \// S!Q/ S"QS#S$\R$                  /S#S$\// S%Q/5      S& 5       r\R
                  R                  S'\" S\R$                  S(S)/5      \" \" S5      \R$                  \R$                  \R$                  /5      /\" SS(S)\R$                  /5      \" \" S5      \R$                  \R$                  \R$                  /5      /\" S*\R$                  S+S,/5      \" \" S-5      \R$                  \R$                  \R$                  /5      /\" S*S+\R$                  S,/5      \" \" S-5      \R$                  \R$                  \R$                  /5      //5      S. 5       r\R
                  R                  S/\R0                  /S0\" S1/5      4\R0                  /S2\" S1/5      4\R0                  S3/S0\" S1S4/5      4S5\R0                  /S6\" S7S1/5      4S5\R0                  /S8\" S9S1/5      4S2\R$                  \R0                  /S2\" / S:Q5      4S2\R$                  \R0                  /S;\" / S:Q5      4/5      S< 5       rS= rS> r\R
                  R                  S?S@\" SASBSC5      /SD\" SESFSG5      /SHSH/SISI/SJSJ/SKSK//5      SL 5       rSM r\R
                  R                  SNSOSP\" SQ5      /SRSS\" ST5      /SUSV\" SW5      /\R@                  " SXSY\" SZ5      \R
                  RC                  \"RF                  " 5       S[   S\;   S]SS^9S_9\R@                  " S`SY\" Sa5      \R
                  RC                  \"RF                  " 5       S[   S\;   S]SS^9S_9\R@                  " SbSc\" Sd5      \R
                  RC                  \"RF                  " 5       S[   S\;   S]SS^9S_9/5      Se 5       r$\%RL                  Sf 5       r'\R
                  R                  SSg\" ShSiSF5      4Sj\" ShSFSi5      4Sk\" ShSiSFSl5      4Sm\" ShSFSiSl5      4Sn\" ShSiSFSlSo5      4Sp\" ShSFSiSlSo5      4Sq\" ShSiSFSlSoSr5      4Ss\" ShSFSiSlSoSr5      4St\" ShSiSFSlSoSrSu5      4Sv\" ShSFSiSlSoSrSu5      4Sw\" ShSiSFSlSoSrSuSxSy94Sz\" ShSFSiSlSoSrSuSxSy94/5      S{ 5       r(\R
                  R                  S|/ S}Q5      S~ 5       r)\R
                  R                  SSS\" S5      /SS\" S5      //5      S 5       r*\R
                  R                  SSS/S-  \" SSSy9/S-  /SS/S-  \" S\+" \," SS95      S9/S-  /SS/S-  \" S\+" \," SS95      S9/S-  /SSS/\" S\-R\                  " S[5      S9\" S\-R\                  " S[5      S9///5      S 5       r/\R
                  R                  SS/ SQ\" SSSy9\" SSSy9\" SSSy9//SSS/\" S\+" \," SS95      S9\" S\+" \," SS95      S9///5      S 5       r0S r1\R
                  R                  S/ SQ5      S 5       r2S r3Sr4g2)TestTimeConversionFormatsU   readonlyTFc                     [         R                  " / [        S9nU(       a  UR                  SS9  [	        U5      n[	        / 5      n[
        R                  " X45        g )NdtypeF)write)nparrayobjectsetflagsr   tmassert_index_equal)selfr+   arrresultexpecteds        r%   test_to_datetime_readonly3TestTimeConversionFormats.test_to_datetime_readonlyV   sF     hhr(LLuL%S!r?
f/r'   zformat, expected%d/%m/%Y200001012000020120000301%m/%d/%Y2000010220000103c                 h    U" / SQ5      n[        XSUS9nU" U5      n[        R                  " Xd5        g )N)1/1/20001/2/20001/3/2000formatr&   )r   r4   assert_equal)r6   r&   index_or_seriesrH   r9   valuesr8   s          r%   test_to_datetime_format1TestTimeConversionFormats.test_to_datetime_format`   s1     !!EFV%@"8,
)r'   zarg, expected, format)rD   r=   r<   )rD   r=   r@   )rE   r>   r<   )rE   rA   r@   )rF   r?   r<   )rF   rB   r@   c                 <    [        X$US9n[        U5      nXS:X  d   eg NrG   r   r   )r6   r&   argr9   rH   r8   s         r%   test_to_datetime_format_scalar8TestTimeConversionFormats.test_to_datetime_format_scalars   s&     Su=X&!!!r'   c                 P   [        SS/S/S-  -   5      n[        UR                  [        5       Vs/ s H  n[        U5      PM     sn5      n[	        USUS9n[
        R                  " XT5        [	        UR                  [        5      SUS9n[
        R                  " XT5        g s  snf )N$.9G.   %Y%m%drG   r   applystrr   r   r4   assert_series_equalr6   r&   serxr9   r8   s         r%    test_to_datetime_format_YYYYMMDD:TestTimeConversionFormats.test_to_datetime_format_YYYYMMDD   s    h)XJN:;3@A9Q<@AS?
v0SYYs^HEJ
v0 As   B#c                    [        SS/S/S-  -   SS9n[        [        S5      [        S5      /[        S5      /S-  -   5      n[        R                  US'   [        R                  US'   [	        US	US
9n[
        R                  " XC5        UR                  [        5      nSUS'   [        R                  " [        SS9   [	        US	US
9  S S S 5        g ! , (       d  f       g = f)NrU   rV   rW   floatr-   1980122219810105   rX   rG   natzOunconverted data remains when parsing with format "%Y%m%d": ".0", at position 0match)r   r   r0   nanr   r4   r\   rZ   r[   pytestraises
ValueError)r6   r&   r^   r9   r8   ser2s         r%   )test_to_datetime_format_YYYYMMDD_with_natCTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_with_nat   s    h)XJN:'Jz"Ij$9:i
>S=TWX=XX
 ffAS?
v0 yy~Q]] 
 XU;
 
 
s   =C
C c                    [        SS/S/S-  -   SS9n[        [        S5      [        S5      /[        S5      /S-  -   5      n[        R                  US'   [        R                  US'   [	        US	US
9n[
        R                  " XC5        g )Ni| i rW   rc   r-   1980120119810101rf   %Y%mrG   )r   r   r0   rj   r   r4   r\   )r6   r&   r^   r9   r8   s        r%   'test_to_datetime_format_YYYYMM_with_natATestTimeConversionFormats.test_to_datetime_format_YYYYMM_with_nat   s     ff%14GDz"Ij$9:i
>S=TWX=XX
 ffASu=
v0r'   c                     [        / SQ5      n[        USSUS9n[        / SQ[        S9n[        R                  " X45        g )Ni3iT3irX   ignorerH   errorsr&   r-   )r   r   r2   r4   r\   r6   r&   r^   r8   r9   s        r%   'test_to_datetime_format_YYYYMMDD_ignoreATestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_ignore   s?     34S(%P*
 	v0r'   c                     [        SS[        R                  /SSUS9n[        SS[        R                  /[        S9n[
        R                  " X#5        g )N1501010120150101rX   ry   rz   r-   )r   r0   rj   r   r2   r4   r5   r6   r&   r8   r9   s       r%   8test_to_datetime_format_YYYYMMDD_ignore_with_outofboundsRTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_ignore_with_outofbounds   sJ    RVV,	
 *j"&&9H
f/r'   c                 z    [        / SQ5      n[        USSUS9n[        / SQSS9n[        R                  " X45        g )Nrx   rX   coercerz   )2012123120141231r   M8[ns]r-   r   r   r4   r\   r|   s        r%   )test_to_datetime_format_YYYYMMDD_coercionCTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_coercion   s:     34S(%P9J
v0r'   input_s)rd   20010112Nrd   r   )rd   r   r   )rU   T1NrU   r   )rU   r   r   c                     [        [        S5      [        S5      [        /5      n[        [        USS95      n[        R
                  " X25        g )Nrd   r   rX   rH   )r   r   r   r   r4   r\   r6   r   r9   r8   s       r%   *test_to_datetime_format_YYYYMMDD_with_noneDTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_with_none   s>    & 9Z0)J2GMNGH=>
v0r'   zinput_s, expected2001001210019999i]4iT1i{120190813c                 F    [        USSS9n[        R                  " X25        g )NrX   r   rH   r{   )r   r4   r\   r   s       r%   )test_to_datetime_format_YYYYMMDD_overflowCTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_overflow   s     8 WXhG
v0r'   zdata, format, expectedz%Y%m%d%H%M%Sr   N20210202202020z2021-02-02 20:20:20201010z%y%m%dz
2020-10-10z%d%m%y
2010-10-20)r   r   r   rX   c                 B    [        XS9n[        R                  " XC5        g Nr   r   r4   r5   )r6   datarH   r9   r8   s        r%   test_to_datetime_with_NA2TestTimeConversionFormats.test_to_datetime_with_NA  s    $ T1
f/r'   c                     [        S[        R                  /5      n[        SS/5      n[        R
                  " X5        g )Nr   r   r   )r   pdNAr   r4   r5   r6   r8   r9   s      r%   %test_to_datetime_with_NA_with_warning?TestTimeConversionFormats.test_to_datetime_with_NA_with_warning  s2    h./ ,!67
f/r'   c                    [        / SQ5      n[        UR                  [        5       Vs/ s H  n[        U5      PM     sn5      n[	        USUS9n[
        R                  " XT5        [        / SQ5      n[        UR                  [        5       Vs/ s H  n[        US S S-   USS  -   5      PM     sn5      n[	        USUS9n[
        R                  " XT5        g s  snf s  snf )N)    i  z%YrG   )iA i i    -rt   rY   r]   s         r%   test_to_datetime_format_integer9TestTimeConversionFormats.test_to_datetime_format_integer"  s    '(3@A9Q<@ASU;
v0-.399S>R>a9QrUS[1QR5%89>RSSu=
v0 A Ss   C!Czint_date, expectedi3  
      i i     r   iuwi(3iA iI  c                 (    [        USSS9nX2:X  d   eg )NrX   ry   r   r   )r6   int_dater9   r8   s       r%   .test_int_to_datetime_format_YYYYMMDD_typeerrorHTestTimeConversionFormats.test_int_to_datetime_format_YYYYMMDD_typeerror0  s    & XhxH!!!r'   c                     [         R                  S   nSU S3nSn[        X4US9n[        R                  " X45      nXV:X  d   eg )Nr   z01-z-2011 00:00:01.978z%d-%b-%Y %H:%M:%S.%frG   )calendar
month_abbrr   r   strptime)r6   r&   r   valrH   r8   exps          r%   #test_to_datetime_format_microsecond=TestTimeConversionFormats.test_to_datetime_format_microsecondF  sL    ((+
J<12'Su=,}}r'   zvalue, format, dtz01/10/2010 15:20z%m/%d/%Y %H:%Mz2010-01-10 15:20z01/10/2010 05:43z%m/%d/%Y %I:%Mz2010-01-10 05:43z01/10/2010 13:56:01z%m/%d/%Y %H:%M:%Sz2010-01-10 13:56:01z01/10/2010 08:14 PMz%m/%d/%Y %I:%M %pz2010-01-10 20:14r   )zh_CNit_ITz4fail on a CI build with LC_ALL=zh_CN.utf8/it_IT.utf8)reasonstrict)marksz01/10/2010 07:40 AMz2010-01-10 07:40z01/10/2010 09:12:56 AMz%m/%d/%Y %I:%M:%S %pz2010-01-10 09:12:56c                 $    [        X#US9U:X  d   eg rO   r   )r6   r&   valuerH   dts        r%   test_to_datetime_format_time6TestTimeConversionFormats.test_to_datetime_format_timeO  s    Z 5u=CCCr'   c                     [        / SQ5      n[        USSUS9n[        UR                  R                  SSS9SUS9n[        R
                  " X45        g )N)19MAY11foobar19MAY11z19MAY11:00:00:00z19MAY11 00:00:00Zz%d%b%yF)rH   exactr&   z(\d+\w+\d+))expandrG   )r   r   r[   extractr4   r\   r|   s        r%   test_to_datetime_with_non_exact9TestTimeConversionFormats.test_to_datetime_with_non_exact~  sV    
 Q
 SeLGGOON5O9(RW
 	v0r'   %Y-%m-%dr      %Y-%d-%m%Y-%m-%d %H   z%Y-%d-%m %H%Y-%m-%d %H:%M"   z%Y-%d-%m %H:%M%Y-%m-%d %H:%M:%S8   %Y-%d-%m %H:%M:%S%Y-%m-%d %H:%M:%S.%f@ z%Y-%d-%m %H:%M:%S.%f%Y-%m-%d %H:%M:%S.%f%z	UTC+01:00tzz%Y-%d-%m %H:%M:%S.%f%zc                 (    [        SUSS9nXC:X  d   eg )Nz 2000-01-03 12:34:56.123456+01:00FrH   r   r   )r6   r&   rH   r9   r8   s        r%   (test_non_exact_doesnt_parse_whole_stringBTestTimeConversionFormats.test_non_exact_doesnt_parse_whole_string  s#    4 .vU
 !!!r'   rQ   )z2012-01-01 09:00:00.000000001z2012-01-01 09:00:00.000001z2012-01-01 09:00:00.001z2012-01-01 09:00:00.001000z2012-01-01 09:00:00.001000000c                 :    [        X!S9n[        USUS9nXC:X  d   eg )Nr&   r   rG   r   )r6   r&   rQ   r9   r8   s        r%   #test_parse_nanoseconds_with_formula=TestTimeConversionFormats.test_parse_nanoseconds_with_formula  s)     s0S)?uM!!!r'   zvalue,fmt,expected2009324z%Y%W%wz
2009-08-132013020z%Y%U%wz
2013-01-13c                 $    [        XUS9U:X  d   eg rO   r   )r6   r   fmtr9   r&   s        r%   test_to_datetime_format_weeks7TestTimeConversionFormats.test_to_datetime_format_weeks  s     5E:hFFFr'   zfmt,dates,expected_datesz%Y-%m-%d %H:%M:%S %Z2010-01-01 12:00:00 UTCrf   2010-01-01 12:00:00UTC%Y-%m-%d %H:%M:%S%zz2010-01-01 12:00:00+0100<   minutestzinfo%Y-%m-%d %H:%M:%S %z2010-01-01 12:00:00 +01002010-01-01 12:00:00 Zc                 X    [        X!S9n[        U5      n[        R                  " XE5        g r   )r   r   r4   rI   )r6   r   datesexpected_datesr8   r9   s         r%   )test_to_datetime_parse_tzname_or_tzoffsetCTestTimeConversionFormats.test_to_datetime_parse_tzname_or_tzoffset  s%    T U/(
)r'   )r   z2010-01-01 12:00:00 GMTz2010-01-01 12:00:00 US/PacificGMT
US/Pacific2010-01-01 12:00:00 -0100c                     Sn[         R                  " [        US9   [        X!S9nS S S 5        [	        U5      n[         R
                  " WU5        g ! , (       d  f       N1= f)N;parsing datetimes with mixed time zones will raise an errorrh   r   )r4   assert_produces_warningFutureWarningr   r   rI   )r6   r   r   r  msgr8   r9   s          r%   >test_to_datetime_parse_tzname_or_tzoffset_utc_false_deprecatedXTestTimeConversionFormats.test_to_datetime_parse_tzname_or_tzoffset_utc_false_deprecated  sM    D L''SA 3F B(
) BAs   
A
Ac                 n    / SQn/ SQnSn[        XSS9n[        U5      n[        R                  " XE5        g )N)r   r  z2010-01-01 12:00:00 +0300z2010-01-01 12:00:00 +0400)z2010-01-01 11:00:00+00:00z2010-01-01 13:00:00+00:00z2010-01-01 09:00:00+00:00z2010-01-01 08:00:00+00:00r   TrH   utcr   r   r4   r5   )r6   r   r  r   r8   r9   s         r%   =test_to_datetime_parse_tzname_or_tzoffset_different_tz_to_utcWTestTimeConversionFormats.test_to_datetime_parse_tzname_or_tzoffset_different_tz_to_utc  s;    

 %UD9 0
f/r'   offset)z+0z-1fooUTCbarz:10z
+01:000:01r   c                     SnSU-   nSR                  S[         S3S[         S3/5      n[        R                  " [        US9   [        U/US9  S S S 5        g ! , (       d  f       g = f)	Nr   z2010-01-01 12:00:00 |z;^time data ".*" doesn\'t match format ".*", at position 0. $N^unconverted data remains when parsing with format ".*": ".*", at position 0. rh   r   joinPARSING_ERR_MSGrk   rl   rm   r   )r6   r  r   r   r  s        r%   )test_to_datetime_parse_timezone_malformedCTestTimeConversionFormats.test_to_datetime_parse_timezone_malformed0  sp     %%.hhN"#1&""1!2!5
 ]]:S1s+ 211s   A
A'c                 t    Sn[        S/SS9n[        X!S9n[        S/SSS9n[        R                  " X45        g )	Nr   r   foonamer   r   r   )r   r#  )r   r   r   r4   r5   )r6   r   rQ   r8   r9   s        r%   *test_to_datetime_parse_timezone_keeps_nameDTestTimeConversionFormats.test_to_datetime_parse_timezone_keeps_nameB  sA    $,-E:S- "7!8UO
f/r'    )5__name__
__module____qualname____firstlineno__rk   markparametrizer:   r   rL   rR   r`   ro   ru   r}   r   r   r0   rj   r   r   r   r   r   r   r   r   r   r   r   r   r   r"   xfaillocale	getlocaler   tdskip_if_not_us_localer   r   r   r   r   r   pytzFixedOffsetr  r  r  r  r$  __static_attributes__r&  r'   r%   r)   r)   U   s	   [[Z$70 80 [[ :&	*(=y?TU
 :&	*(=y?TU		
** [[000000	

"
"
1<4
1	1	01 [[ +RVV,S)+&x(x%'	
11 [[ 
BFFJ
CD	*-rvvrvvrvvFG 
J
BFFCD	*-rvvrvvrvvFG "&&(H=>	*-rvvrvvrvvFG (BFFH=>	*-rvvrvvrvvFG#	
21321 [[ eeWnmUG&<=eeWdM5'23()u&;<=
 -u8M*NO-u8M*NOBFFBEE"D-8M*NOBFFBEE"Hm<Q.RS	
 0! 0
01 [[ xb"-.XdAq)*$x g4L	
""#""
 [[!19=O3PQ!19=O3PQ%#/0 LL%#,-kk''$$&q)-??Q  ( 		 LL%#,-kk''$$&q)-??Q  ( 		 LL(&/0kk''$$&q)-??Q  ( 		=(	
+XDY+XD 1 1 [[4A./4A./IdAq"56IdAq"56yq!R<=yq!R<= )D!QB"CD )D!QB"CD#YtQ2r2v%NO#YtQ2r2v%NO($1b"b&[I
 )$1b"b&[I	
."/." [[	
	"	" [[)L"9:)L"9:	
GG [[" '*+a/0U;<q@ &+,q0-hyQS?T6U
 	 ',-1-hyQS?T6U
 	 '(*AB-d6F6Fq6I 3D<L<LQ<OP		5$	
'P*Q'P* [[" ' 3>3>3E ',.IJ-hyQS?T6U -hyQT?U6V		
<*=<*0( [[D,,0r'   r)   c                      \ rS rSr\R
                  R                  S5      S 5       rS rS r	\R
                  R                  SSS/S	S
/S9S 5       r\R
                  R                  SSS/SS/S9\R
                  R                  S\R                  " SSS/\" SS/SS9SS9\R                  " SSS/\" SS/5      SS9\R                  " SSS/\" SS/SS9S S9\R                  " SS!S/\" SS/SS9S"S9/5      \R
                  R                  S#\S$ /5      S% 5       5       5       r\R
                  R                  SSS/SS/S9\R
                  R                  S#\S& /5      S' 5       5       r\R
                  R                  S(\R                  " S\" \" S)S*S+9\" S,S-S+9\/5      S.S9\R                  " S\" \" S)S*S+9\" S/S-S+9\/5      S0S9/5      S1 5       r\R
                  R                  S(\R                  " S\" / S2QSS9S3S9\R                  " S\" / S4QSS9S5S9/5      S6 5       r\R
                  R                  SSS/SS/S9\R
                  R                  S7\R                  " SS8/S9S9/5      \R
                  R                  S#\S: /5      S; 5       5       5       rS< r\R
                  R                  S=S>S?\" S@SASBSCSC5      /SDS?\" SESFSFSCSC5      /SGS?\" SESFSHSCSC5      //5      SI 5       r\R
                  R                  SJ/ SKQ/ SLQ/ SMQ/ SNQ/ SOQ/ SPQ/ SQQ/ SRQ/ SSQ/ STQ/ SUQ/ SVQ/ SWQ/ SXQ/ SYQ/ SZQ/ S[Q/ S\Q/ S]Q/5      \R
                  R                  S^/ S_Q5      S` 5       5       r\R
                  R                  SaSbSc/5      Sd 5       r\R8                  \R
                  R                  Se\\/5      \R
                  R                  SfSS/5      \R
                  R                  SaSbSc/5      Sg 5       5       5       5       rSh rSi r Sj r!\R8                  Sk 5       r"\R8                  \R
                  R                  SaSlSm/5      Sn 5       5       r#\R
                  R                  SoSpSq/5      Sr 5       r$\R
                  R                  Ss/ StQ5      \R
                  R                  SuSvSw/5      Sx 5       5       r%\R
                  R                  Sy\&RN                  " Sz5      \&RN                  " S{5      /5      S| 5       r(\R
                  R                  S}S~S/5      S 5       r)\R
                  R                  Sy\&RN                  " S5      \&RN                  " S5      /5      \R
                  R                  S^/ SQ5      S 5       5       r*\R
                  RV                  S 5       r,\R
                  R                  SSS/5      S 5       r-S r.S r/S r0S r1S r2S r3\R
                  R                  S\\4\4\4\&Rj                  \4\\4/5      S 5       r6\R
                  R                  SS\" SSfS+9/S\" SSfS+9//5      S 5       r7S r8S r9\R
                  R                  SSS/5      S 5       r:S r;\R
                  R                  SoSS/5      S 5       r<S r=\R
                  R                  So\>\?/5      S 5       r@\R
                  R                  S^/ SQ5      S 5       rA\R
                  R                  SSS/5      \R
                  R                  SSbS/5      S 5       5       rB\R
                  R                  SS/5      \R
                  R                  SSbS/5      S 5       5       rC\R
                  R                  SS/S// SQ/5      \R
                  R                  SSbS/5      S 5       5       rD\R
                  R                  SfSSb/5      \R
                  R                  SSSb/5      \R
                  R                  S#\4\E\&Rj                  \\F/5      S 5       5       5       rGS rH\R
                  R                  SfSSb/5      \R
                  R                  SSSb/5      S 5       5       rIS rJ\R
                  R                  SSb\&R                  4\4\L-  -   \4\LS-   -  4Sb\" S5      4\4\L-  -   \\" S5      4\4\L-  -   4S\4\L-  -   S\" S5      4-   \4\LSF-   -  \" S5      \" S5      4-   445      S 5       rM\R
                  R                  SSS/5      \R
                  R                  S\" \/S-  Sb/S-  -   SS9\" \/S-  Sb/S-  -   SS9\" Sb/S-  5      \" Sb/S-  5      \" S/S-  5      \" S/S-  5      \" \NR                  /S-  5      \" \NR                  /S-  5      \" \&R                  /S-  5      \" \&R                  /S-  5      /
5      S 5       5       rP\R
                  R                  S/ SQ5      S 5       rQS rR\R
                  R                  SSS/5      \R
                  R                  S\" SSFSF5      \S" SSFSF5      \&RN                  " S5      SS/5      S 5       5       rT\R
                  R                  SS\" \\/5      4S\" SS/\US94/5      S 5       rVS rWS rXS rYS rZS r[S r\\R
                  R                  S\" S5      \" SSS+94\" SSS+9\" SSS+94/5      S 5       r]\R
                  R                  S/ SQ5      S 5       r^S r_S r`\R
                  R                  SSS/S\" SSS+9/S\" SSFSFS\aR                  " S5      S9//5      S 5       rcSrdgb)TestToDatetimeiK  zignore:Could not infer formatc                 :   SnSn[         R                  " [        US9   [        U5        S S S 5        [         R                  " [        US9   [        U/5        S S S 5        [        USS9nU[        L d   e[        U/SS9n[
        R                  " U[        [        /5      5        [        USS9n[        U[        5      (       a  X1:X  d   e[        U/SS9n[
        R                  " U[        U/[        S95        g ! , (       d  f       N= f! , (       d  f       N= f)N08335394550z:Parsing "08335394550" to datetime overflows, at position 0rh   r   r{   ry   r-   )rk   rl   r   r   r   r4   r5   r   
isinstancer[   r2   )r6   rQ   r  ress       r%   test_to_datetime_overflow(TestToDatetime.test_to_datetime_overflowL  s    
 J]].c: ; ]].c: ; #h/czz3%1
c5#<0#h/#s##
223%1
c5#f#=> ;: ;:s   C;D;
D	
Dc                    [        SSSS[        [        SS9* 5      S9n[        SSSS[        [        SS9* 5      S9n[        SU/5      n[        X/5      R	                  [        [        SS	95      5      n[
        R                  " X45        g )
N  r      )hoursr      z2020-01-01 17:00 -0100r  r   )r   r   r   r   
tz_convertr4   r5   )r6   d1d2r;  r9   s        r%   *test_to_datetime_mixed_datetime_and_string9TestToDatetime.test_to_datetime_mixed_datetime_and_stringc  s    dAq"Xyq7I6I-JKdAq"Xyq7I6I-JK3R89x(33HYs=S4TU
c,r'   c                    SS/n[        U Vs/ s H  n[        U5      PM     sn5      n[        USS9n[        US S S2   SS9S S S2   n[        U5      n[        US S S2   5      S S S2   n[        R                  " XC5        [        R                  " XS5        [        R                  " Xc5        [        R                  " Xs5        g s  snf )Nz
2016-01-01r   mixedr   r   r   r   r4   r5   )r6   valsr_   r9   r8   result2result3result4s           r%   )test_to_datetime_mixed_string_and_numeric8TestToDatetime.test_to_datetime_mixed_string_and_numerick  s    a  !=1)A,!=>T'2d4R4j9$B$?%TrT
+DbD1
f/
g0
g0
g0 ">s   CrH   r   r   ISO8601non-ISO8601idsc                 z    [        SSS5      n[        SU/US9n[        SS/SS9n[        R                  " X45        g )	Nr?  r   rf   
2020-01-01r   z
2020-01-02r   r-   )r   r   r   r4   r5   )r6   rH   rD  r;  r9   s        r%   &test_to_datetime_mixed_date_and_string5TestToDatetime.test_to_datetime_mixed_date_and_stringy  sB    
 $1<,V< ,!=XN
c,r'   r   %Y-%d-%m %H:%M:%S%zr   znon-ISO8601 formatzISO8601 formatzutc, args, expectedTz2000-01-01 01:00:00-08:00z2000-01-01 02:00:00-08:00z2000-01-01 09:00:00+00:00z2000-01-01 10:00:00+00:00datetime64[ns, UTC]r-   zall tz-aware, with utc)idFz2000-01-01 01:00:00+00:002000-01-01 02:00:00+00:00zall tz-aware, without utcz%all tz-aware, mixed offsets, with utc2000-01-01 01:00:00z+tz-aware string, naive pydatetime, with utcconstructorc                 4    [        U 5      R                  5       $ Nr   to_pydatetimer_   s    r%   <lambda>TestToDatetime.<lambda>      il88:r'   c                 f    U" US   5      nUS   n[        Xg/XS9n[        R                  " X5        g )Nr   r   r  r   )	r6   r   r  argsr9   r_  ts1ts2r8   s	            r%   6test_to_datetime_mixed_datetime_and_string_with_formatETestToDatetime.test_to_datetime_mixed_datetime_and_string_with_format  s8    p $q'"1gcZ=
f/r'   c                 4    [        U 5      R                  5       $ ra  rb  rd  s    r%   re  rf    rg  r'   c                    SS/nU" US   5      nUS   nSn[        [        S5      [        SSS9/5      n[        R                  " [        US	9   [        XE/US
S9nS S S 5        [        R                  " WU5        g ! , (       d  f       N&= f)Nr^  r]  r   r   r	  z2000-01-01 02:00:00+0000r   r   rh   Fr  )r   r   r4   r
  r  r   r5   )	r6   r   r_  ri  rj  rk  r  r9   r8   s	            r%   Ntest_to_datetime_mixed_datetime_and_string_with_format_mixed_offsets_utc_false]TestToDatetime.test_to_datetime_mixed_datetime_and_string_with_format_mixed_offsets_utc_false  s      &'BC$q'"1gK/04?
 ''SA #CUCF B
fh/ BAs   A;;
B	zfmt, expectedz2000-01-01 09:00:00+0100r   r   z2000-01-02 02:00:00+0200z	UTC+02:00zISO8601, non-UTCz2000-02-01 02:00:00+0200znon-ISO8601, non-UTCc                     Sn[         R                  " [        US9   [        / SQUSS9nS S S 5        [         R                  " WU5        g ! , (       d  f       N&= f)Nr	  rh   z2000-01-01 09:00:00+01:00z2000-01-02 02:00:00+02:00NFr  r4   r
  r  r   r5   )r6   r   r9   r  r8   s        r%   +test_to_datetime_mixed_offsets_with_none_tz:TestToDatetime.test_to_datetime_mixed_offsets_with_none_tz  sO    : L''SA PF B 	fh/ BAs   A


A)2000-01-01 08:00:00+00:00z2000-01-02 00:00:00+00:00r   zISO8601, UTC)rw  z2000-02-01 00:00:00+00:00r   znon-ISO8601, UTCc                 J    [        / SQUSS9n[        R                  " X25        g )Nrs  Tr  r   )r6   r   r9   r8   s       r%   (test_to_datetime_mixed_offsets_with_none7TestToDatetime.test_to_datetime_mixed_offsets_with_none  s'    . L

 	f/r'   ri  z2000-01-01 02:00:00-07:00z*all tz-aware, mixed timezones, without utcc                 4    [        U 5      R                  5       $ ra  rb  rd  s    r%   re  rf  4  rg  r'   c                     U" US   5      nU" US   5      n[         R                  " [        SS9   [        XE/USS9  S S S 5        g ! , (       d  f       g = f)Nr   r   z1cannot be converted to datetime64 unless utc=Truerh   Fr  rk   rl   rm   r   )r6   r   ri  r_  rj  rk  s         r%   =test_to_datetime_mixed_datetime_and_string_with_format_raisesLTestToDatetime.test_to_datetime_mixed_datetime_and_string_with_format_raises$  sR    0 $q'"$q'"]]Q
 
3E:
 
 
s   A
Ac                 n   [         R                  " S5      n[        U/5      n[        SSS9n[	        U5      U:X  d   e[	        UR
                  S   5      U:X  d   e[	        U/5      n[        U/5      n[        R                  " XE5        [	        U5      n[        U5      n[        R                  " XE5        g )Nz2019-02-04 10:18:46.297000+0000z2019-02-04 10:18:46.297000r   r   r   )
r0   str_r   r   r   ilocr   r4   r5   r\   )r6   r   r^   r   r;  r9   s         r%   test_to_datetime_np_str&TestToDatetime.test_to_datetime_np_strC  s     9:eWo4?5!S(((388A;'3...5'"#<
c,#(#
s-r'   zs, _format, dtz2015-1-1z%G-%V-%u  r      r   z2015-1-4  r   z2015-1-7r   c                 "    [        XS9U:X  d   eg r   r   )r6   s_formatr   s       r%   %test_to_datetime_iso_week_year_format4TestToDatetime.test_to_datetime_iso_week_year_formatW  s     1-333r'   zmsg, s, _format)dISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G' instead.1999 50z%Y %V)xISO year directive '%G' must be used with the ISO week directive '%V' and a weekday directive '%A', '%a', '%w', or '%u'.z1999 51z%G %V)r  z1999 Mondayz%G %A)r  z1999 Monz%G %a)r  1999 6z%G %w)r  r  z%G %u)r  2051z%G)`Day of the year directive '%j' is not compatible with ISO year directive '%G'. Use '%Y' instead.z1999 51 6 256z%G %V %u %j)r  1999 51 Sundayz%Y %V %A)r  1999 51 Sunz%Y %V %a)r  	1999 51 1z%Y %V %w)r  r  z%Y %V %u)xISO week directive '%V' must be used with the ISO year directive '%G' and a weekday directive '%A', '%a', '%w', or '%u'.20z%V)r  r  %V %A)r  r  z%V %a)r  r  z%V %w)r  r  z%V %u)r  r  z%G %j)r  z	20 Mondayr  r{   raiser   ry   c                     [         R                  " 5       S:w  aG  [         R                  " 5       S:w  a-  [        R                  " [        US9   [        X#US9  S S S 5        g g g ! , (       d  f       g = f)N)r   UTF-8)r   r  rh   r   )r.  r/  rk   rl   rm   r   )r6   r  r  r  r{   s        r%   test_error_iso_week_year'TestToDatetime.test_error_iso_week_yearc  s`    @ !338H8H8J O
 9
 z5Af= 65	9
3 65s   A""
A0r   Nz
US/Centralc                 V    [        SSSUS9nUR                  n[        U5      nXCL d   eg )N
1965-04-03   2Wperiodsfreqr   )r   _datar   )r6   r   dtir7   r8   s        r%   test_to_datetime_dtarr%TestToDatetime.test_to_datetime_dtarr  s1     rDiiS!}}r'   	arg_classr  c           	         [         R                  " S5      n[        SSSUS9nU" U5      nUR                  [        R
                  " UR                  SUS95      5      n[        XbS9n[        XRS9R                  [        R
                  " UR                  SU(       d  UOS	S95      5      nU(       d  U[        La  XvL d   eU[        L a  [        R                  " Xx5        g [        R                  " Xx5        g )
Npyarrowr  r  r  r  ns)unitr   r  r   )rk   importorskipr   astyper   
ArrowDtype	timestampr   r   r4   r\   r5   )	r6   r   r  r  par  	dti_arrowr8   r9   s	            r%   test_to_datetime_arrow%TestToDatetime.test_to_datetime_arrow  s    
   +rDnJJr}}R\\t\-KLM	Y0s,33MM",,DsR,NO
 y. &&&""64!!&3r'   c                 V    [        [        SSS5      5      nU[        SSS5      :X  d   eg )N  r      r   r   r6   actuals     r%   test_to_datetime_pydatetime*TestToDatetime.test_to_datetime_pydatetime  s,    XdAr23$2....r'   c                 @    [        S5      nU[        SSS5      :X  d   eg )N20080115r  r   r  r  r  s     r%   test_to_datetime_YYYYMMDD(TestToDatetime.test_to_datetime_YYYYMMDD  s#    Z($2....r'   c                 (    Sn[        USS9U:X  d   eg )NzMonth 1, 1999ry   r9  r   )r6   r^   s     r%   "test_to_datetime_unparsable_ignore1TestToDatetime.test_to_datetime_unparsable_ignore  s    3x0C777r'   c                    [         R                  " S5         [        S5      R                  S5      n[	        S5      n[	        S/5      S   n[        UR                  UR                  -
  5      S:  d   e[        UR                  UR                  -
  5      S:  d   eUR                  b   eUR                  b   e S S S 5        g ! , (       d  f       g = f)N
US/Easternnowr  r       _B)r4   set_timezoner   as_unitr   abs_valuer   )r6   r  pdnowpdnow2s       r%   test_to_datetime_now#TestToDatetime.test_to_datetime_now  s     __\*E"**40C&E %)!,F u||cjj01D888v}}szz12T999<<'''==((( +**s   B#C
CzPacific/AucklandzUS/Samoac                 &   [         R                  " U5         [        R                  " S5      R	                  S5      R	                  [        R
                  5      n[        S5      n[        S/5      S   n[        S5      R                  S5      n[        R                  " 5       R                  S5      n[        UR                  5       R                  U-
  5      S:  d   e[        UR                  5       R                  U-
  5      S:  d   e[        UR                  UR                  -
  5      S:  d   e[        UR                  UR                  -
  5      S:  d   eUR                  b   eUR                  b   e S S S 5        g ! , (       d  f       g = f)Ntodaydatetime64[ns]r   r  r  )r4   r  r0   
datetime64r  int64r   r   r  r  r  	normalizer  r   )r6   r   nptodaypdtodaypdtoday2tstodaytstoday2s          r%   test_to_datetime_today%TestToDatetime.test_to_datetime_today+  s<    __R mmG,334DELLRXXVG!'*G"G9-a0H(006G (006H w((*11G;<tCCCx))+22W<=DDDw~~67$>>>w~~784???>>)))??***! !  s   E!F
FrQ   r  r  c                     [        U/5        g ra  r   )r6   rQ   s     r%   (test_to_datetime_today_now_unicode_bytes7TestToDatetime.test_to_datetime_today_now_unicode_bytesF  s    SEr'   zformat, expected_ds))r   
2020-01-03)rZ  z
2020-03-01)Nr  zstring, attribute)r  utcnow)r  r  c                     [        SU/USS9n[        U[        [        U5      " 5       /SS9nXe-
  R	                  5       R                  5       S:  d   eg )Nz2020-01-03 00:00:00ZTr  r[  r-   r   )r   r   getattrr   maxtotal_seconds)r6   rH   expected_dsstring	attributer8   r9   s          r%    test_to_datetime_now_with_format/TestToDatetime.test_to_datetime_now_with_formatJ  s]    " 4f=fRVW ')Y79:BW
 !&&(6681<<<r'   r   
2000-01-01
2000-01-02c                 4    [        X!S9[        U5      :X  d   eg )Nr   rP   )r6   r&   r   s      r%   test_to_datetime_dt64s%TestToDatetime.test_to_datetime_dt64sa  s     2+y}<<<r'   arg, format)
2001-01-01r   )z
01-01-2001z%d-%m-%Yc                     [        U[        R                  " S5      /US9n[        SS/5      n[        R
                  " X45        g )NrW  r   r  )r   r0   r  r   r4   r5   )r6   rQ   rH   r8   r9   s        r%   test_to_datetime_dt64s_and_str-TestToDatetime.test_to_datetime_dt64s_and_strg  s;     c2==#>?O ,!=>
f/r'   z
1000-01-01z
5000-01-02)r  ry   r   c                     [        X#US9n[        U[        5      (       d   eUR                  S:X  d   eUR                  U:X  d   e[        U5      nUR                  S:X  d   eUR                  U:X  d   eg )Nr{   r&   r  )r   r:  r   r  asm8)r6   r&   r   r{   tss        r%   'test_to_datetime_dt64s_out_of_ns_bounds6TestToDatetime.test_to_datetime_dt64s_out_of_ns_boundst  sl     %8"i((((ww#~~ww"}}r]ww#~~ww"}}r'   c                    [         R                  " [         R                  " [         R                  5      R                  S5      nSn[
        R                  " [        US9   [        U5        S S S 5        [
        R                  " [        US9   [        USUS9  S S S 5        [        USUS9[        L d   eg ! , (       d  f       NP= f! , (       d  f       N4= f)NDz7Out of bounds second timestamp: 25252734927768524-07-27rh   r  r  r   )r0   r  iinfor  r  rk   rl   r   r   r   r   )r6   r&   dt64r  s       r%   $test_to_datetime_dt64d_out_of_bounds3TestToDatetime.test_to_datetime_dt64d_out_of_bounds  s    }}RXXbhh/33S9G]].c:dO ;]].c:WE: ; 4>#EEE ;:::s   B5C5
C
Cr  r  r  c                 D   [         R                  " SU5      [         R                  " SU5      /S-  n[        X1S9nU(       a/  [        U Vs/ s H  n[	        U5      R
                  PM     snSS9nO.[        U Vs/ s H  n[	        U5      R
                  PM     snSS9n[        R                  " XF5        U[         R                  " S5      /-   n[        US	S
9  [        USUS9nU(       dE  [        [	        US   5      R
                  [	        US   5      R
                  /S-  [        /-   5      nO[        [         R                  " USS95      n[        R                  " XF5        [        USUS9nU(       d  [        U5      n[        R                  " XF5        g s  snf s  snf )Nr  r  r   r   zM8[s]r-   r   
9999-01-01r  r9  r   r  r   r   ry   )r0   r  r   r   r   r  r4   r5   r   r1   r   )r6   r&   r  dtsr8   r_   r9   dts_with_oobs           r%   test_to_datetime_array_of_dt64s.TestToDatetime.test_to_datetime_array_of_dt64s  sf   
 MM,-MM,-
  S.$%EAil&7&7%EWUH$%EAil&7&7%EXVH
f/ bmmL9:: 	L1\(%H$<?+00)LO2L2Q2QRUWW%H
 %RXXl'%JKH
f/
 \(%H\*H
f/= &F%Es   F:Fc                 z    [        [        R                  " S5      SS9n[        R                  " S5      nX:X  d   eg )Nr  ry   r9  )r   r0   r  r   s      r%    test_out_of_bounds_errors_ignore/TestToDatetime.test_out_of_bounds_errors_ignore  s1    R]]<8J==.!!!r'   c                    Sn[         R                  " [        US9   [        [	        S[
        R                  /5      SS9nS S S 5        [	        S[
        R                  /5      n[         R                  " WU5        g ! , (       d  f       NA= f)Nerrors='ignore' is deprecatedrh   z
2362-01-01ry   r9  )r4   r
  r  r   r   r0   rj   r\   )r6   r  r;  r   s       r%   !test_out_of_bounds_errors_ignore20TestToDatetime.test_out_of_bounds_errors_ignore2  sd    -''SAflBFF%;<XNC BlBFF+,
sC( BAs   $A;;
B	c                     [        SSS9[        SSS9/n[        X!S9n[        SS/SS9n[        R                  " X45        g )Nz2013-01-01 13:00:00-0800r  r   z2013-01-02 14:00:00-0800r   2013-01-01 13:00:002013-01-02 14:00:00r   r   r   r4   r5   )r6   r&   r7   r8   r9   s        r%   test_to_datetime_tz"TestToDatetime.test_to_datetime_tz  sR     0\B0\B
 S. "$9:|
 	f/r'   c                    [        SSS9[        SSS9/nSn[        R                  " [        US9   [	        X!S9  S S S 5        S	n[
        R                  " [        US9   [	        X!S
S9nS S S 5        [        [        S5      [        S5      /SS9n[
        R                  " WU5        [	        X!SS9n[        SS/SS9n[
        R                  " XV5        g ! , (       d  f       N= f! , (       d  f       N= f)Nr  r  r   r  r  zLTz-aware datetime.datetime cannot be converted to datetime64 unless utc=Truerh   r   r  ry   )r&   r{   z2013-01-01 13:00:00-08:00z2013-01-02 14:00:00-05:00r2   r-   r   r   zdatetime64[ns, US/Pacific])r   rk   rl   rm   r   r4   r
  r  r   r5   r   )r6   r&   r7   r  depr_msgr8   r9   s          r%   test_to_datetime_tz_mixed(TestToDatetime.test_to_datetime_tz_mixed  s     +=+=

6 	 ]]:S1) 2 3''XF (CF G5656 
 	fh/Sh? (%08T
 	f/% 21 GFs   
CC#
C #
C1c                 $   SnSnU/S-  U/S-  -   n[        U Vs/ s H  n[        U5      PM     sn5      nSn[        R                  " [        US9   [        XAS9nS S S 5        [        R                  " WU5        g s  snf ! , (       d  f       N+= f)NMarch 1, 2018 12:00:00+0400March 1, 2018 12:00:00+0500rW   r	  rh   r   )r   r	   r4   r
  r  r   r5   )	r6   r&   ts_string_1ts_string_2r7   r_   r9   r  r8   s	            r%   "test_to_datetime_different_offsets1TestToDatetime.test_to_datetime_different_offsets  s     43ma;-!"33C0Cq%(C01K''SA 2F B
fh/	 1AAs   A<
B
Bc                 *   [         R                  " S5      n[        R                  " UR	                  [        SSSSSS95      UR	                  [        SSSSSS95      /[        S9n[        US	US
9n[        SS/SS S9n[        R                  " XE5        g )Nr  r   r   r   r   )yearmonthdayhourminute   r-   Tr  r&   rw  2000-06-01 07:00:00+00:00r[  r.   r  )r2  r   r0   r1   localizer   r2   r   r   r4   r5   )r6   r&   
us_easternr7   r8   r9   s         r%   test_to_datetime_tz_pytz'TestToDatetime.test_to_datetime_tz_pytz  s    ]]<0
hh##$aQQqI ##$aQQqI	 

 Sd%8 (*EF'

 	f/r'   z!init_constructor, end_constructorc                     SS/n[        SSS9[        SSS9/n[        U" U5      SSUS	9nU" U5      n[        R                  " Xg5        g )
N20100102 12131420100102 1213152010-01-02 12:13:14r  r   2010-01-02 12:13:15%Y%m%d %H%M%STrH   r  r&   )r   r   r4   rI   )r6   r&   init_constructorend_constructorr   expected_datar8   r9   s           r%   test_to_datetime_utc_true(TestToDatetime.test_to_datetime_utc_true  s^     "#45+6+6

 T"?E
 #=1
)r'   zscalar, expectedr1  r3  r2  r4  c                 *    [        USSUS9nXC:X  d   eg )Nr5  Tr6  r   )r6   r&   scalarr9   r8   s        r%    test_to_datetime_utc_true_scalar/TestToDatetime.test_to_datetime_utc_true_scalar/  s      VOUS!!!r'   c                     Sn[        [        U/5      SUS9n[        [        USS9/5      n[        R                  " X45        g )Ng {ѴCTr)  r  r   )r   r   r   r4   r\   )r6   r&   r  r8   r9   s        r%   2test_to_datetime_utc_true_with_series_single_valueATestToDatetime.test_to_datetime_utc_true_with_series_single_value;  s=    VRD\t5A9RE234
v0r'   c                     SnSn[        U/S-  5      n[        USUS9n[        [        USS9/S-  5      n[        R                  " XV5        g )Nz2013-01-01 00:00:00-01:002013-01-01 01:00:00r   Tr)  r  r   r   r   r   r4   r\   )r6   r&   r  expected_tsr   r8   r9   s          r%   4test_to_datetime_utc_true_with_series_tzaware_stringCTestToDatetime.test_to_datetime_utc_true_with_series_tzaware_stringB  sQ    (+rdQhTt599[U;<q@A
v0r'   zdate, dtype)rD  r  )rD  r[  c                 ~    [        [        SSS9/SS9n[        [        U/US9SUS9n[        R                  " XT5        g )NrD  r   r   M8[ns, UTC]r-   Tr)  r   r   r   r4   r\   )r6   r&   r   r.   r9   r8   s         r%   1test_to_datetime_utc_true_with_series_datetime_ns@TestToDatetime.test_to_datetime_utc_true_with_series_datetime_nsJ  sE     ,78
 VTF%8d%P
v0r'   c                 &   [         R                  " S5      nUR                  SS S9nUR                  SS S9n[        R                  " [        SSSSSUS	9[        SS
SSSUS	9/[        S9n[        USSUS9n[        SS/SS S9n[        R                  " Xx5        [        S/UR                  SS S9S9n	[        U	5      (       d   e[        U	SUS9n[        R                  " Xy5        [        U	SSUS9n[        S/SS9n[        R                  " Xx5        g )Nzpsycopg2.tzi)r  r#  ir   r   r   r   r   r(  r-   r   T)r{   r  r&   rw  r*  r[  r+  z2000-01-01 08:00:00r   r  z2000-01-01 13:00:00)rk   r  FixedOffsetTimezoner0   r1   r   r2   r   r   r4   r5   r   )
r6   r$   r&   psycopg2_tztz1tz2r7   r8   r9   is
             r%   test_to_datetime_tz_psycopg2+TestToDatetime.test_to_datetime_tz_psycopg2X  s:   ))-8 --T-E--T-Ehhq!Q#6q!Q#6 
 St5I (*EF'

 	f/ "#..d.F
 &a(((( Qxu=
f(QxTG "7!8@UV
f/r'   c                     Sn[         R                  " [        US9   [        U5        S S S 5        [        USUS9[        L d   e[        USUS9UL d   eg ! , (       d  f       N3= f)Nz2dtype bool cannot be converted to datetime64\[ns\]rh   r   r  ry   )rk   rl   	TypeErrorr   r   )r6   r&   rQ   r  s       r%   test_datetime_bool!TestToDatetime.test_datetime_bool~  s\     D]]9C0 13xu=DDD3xu=DDD 10s   A
A#c                    [        U5       S3n[        R                  " [        US9   [	        S[
        R                  " 5       /US9  S S S 5        [        R                  " [        S[         S3S9   [	        SS/US9  S S S 5        [        R                  " [	        S	S[        S
/SUS9[        [	        S	US9[        [        [	        S	US9/5      5        g ! , (       d  f       N= f! , (       d  f       Nm= f)Nz is not convertible to datetimerh   Fr   zA^time data "True" doesn\'t match format "%Y%m%d", at position 1. r  20130101Tr   g        r   r  )typerk   rl   rW  r   r   r  rm   r  r4   r5   r   r   r6   r&   r  s      r%   test_datetime_bool_arrays_mixed.TestToDatetime.test_datetime_bool_arrays_mixed  s    e<=]]9C0 01? 1]]""1!2!5
 T*%8
 	E3,XUKQe,c3AU8ST	
 10
 
s    C1C%
C"%
C3c                     Sn[         R                  " [        US9   [        U5        S S S 5        g ! , (       d  f       g = f)Nzis not convertible to datetimerh   )rk   rl   rW  r   )r6   rQ   r  s      r%   test_datetime_invalid_datatype-TestToDatetime.test_datetime_invalid_datatype  s+     /]]9C0 100   1
?)r   r  ry   c                     [         R                  " [        SS9   [        S/SUS9  S S S 5        g ! , (       d  f       g = f)Nz*':' is a bad directive in format 'H%:M%:S%rh   z00:00:00zH%:M%:S%r   r}  )r6   r{   s     r%   test_invalid_format_raises)TestToDatetime.test_invalid_format_raises  s6     ]]J
 ZG
 
 
   0
>r   az00:01:99z%H:%M:%Sc                 *   [        USUS9nX1:X  d   e[        USUS9nU[        L d   eSR                  S[         S3SS[         S3S	[         S
3/5      n[
        R                  " [        US9   [        USUS9  S S S 5        g ! , (       d  f       g = f)Nry   r{   rH   r   r  @^time data "a" doesn\'t match format "%H:%M:%S", at position 0. r  <^Given date string "a" not likely a datetime, at position 0$S^unconverted data remains when parsing with format "%H:%M:%S": "9", at position 0. ^second must be in 0..59: 00:01:99, at position 0$rh   r  )r   r   r  r  NOT_99rk   rl   rm   r6   r   rH   r;  r  s        r%   test_datetime_invalid_scalar+TestToDatetime.test_datetime_invalid_scalar  s     %@||%@czzhhS"#1&O""1!2!5+F83MN	
 ]]:S1gf= 211s   /B
Bz3000/12/11 00:00:00c                 \   [        USUS9nX1:X  d   e[        USUS9nU[        L d   eUb0  Sn[        R                  " [        US9   [        USUS9  S S S 5        g Sn[        R                  " [
        US9   [        USUS9  S S S 5        g ! , (       d  f       g = f! , (       d  f       g = f)Nry   rj  r   z:^time data ".*" doesn\'t match format ".*", at position 0.rh   r  z!^Out of bounds .*, at position 0$)r   r   rk   rl   rm   r   rq  s        r%    test_datetime_outofbounds_scalar/TestToDatetime.test_datetime_outofbounds_scalar  s     %@||%@czzOCz5E'&A 65 6C2#>E'&A ?>	 65 ?>s   B7B
B
B+rK   )rh  bz99:00:00c           	         Uc  [        U5      S:  a  [        nOS n[        R                  " USSS9   [	        USUS9nS S S 5        [        R
                  " W[        Xc  SOSS	95        [        R                  " USSS9   [	        US
US9nS S S 5        [        R
                  " U[        [        /[        U5      -  5      5        SR                  SS[         S3S[         S3S[         S3/5      n[        R                  " [        US9   [        R                  " USSS9   [	        USUS9  S S S 5        S S S 5        g ! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       N:= f! , (       d  f       g = f)Nr   Could not infer formatFri   raise_on_extra_warningsry   rj  r2   r[   r-   r   r  rl  rk  r  rm  rn  ro  rh   r  )lenUserWarningr4   r
  r   r5   r   r   r   r  r  rp  rk   rl   rm   )r6   rK   rH   warnr;  r  s         r%   test_datetime_invalid_index*TestToDatetime.test_datetime_invalid_index  sg    >c&kAoDD''0%
 fXfEC
 	vXUK	
 ''0%
 fXfEC
 	c=#V1D#EFhhOS"#1&""1!2!5+F83MN	
 ]]:S1++4e F76B 211
 

 
"  21s;   D>?E
E2!E!-E2>
E
E!
E/	+E22
F z%Y%m%d %H:%M:%Sc                 |    SnU/S-  nU" U5      n[        XaUSS9n[        XaUSS9n[        R                  " Xx5        g N20130101 00:00:00順 T)r  rH   r&   Fr   )	r6   r  rH   r_  r   
test_datesr   r8   r9   s	            r%   test_to_datetime_cache%TestToDatetime.test_to_datetime_cache  sH     #Ve^
:&T6FtV5I
f/r'   c                     [        [        [        S5      /S-  5      5      n[        [        S5      /S-  5      n[        R                  " X5        g )N2010-06-02 09:30:003   )r   r   r   r4   r5   r   s      r%   test_to_datetime_from_deque*TestToDatetime.test_to_datetime_from_deque
  sE    UI.C$D#E#JKL	*? @ABFG
f/r'   c                     SnU/S-  n[        U5      n[        XQUSS9n[        XQUSS9n[        R                  " Xg5        g r  r   )r6   r  rH   r   r  r   r8   r9   s           r%   test_to_datetime_cache_series,TestToDatetime.test_to_datetime_cache_series  sH     #Ve^
j!T6FtV5I
v0r'   c                 @    Sn[        USS9n[        S5      nX#:X  d   eg )Nr  Tr   rP   )r6   r   r8   r9   s       r%   test_to_datetime_cache_scalar,TestToDatetime.test_to_datetime_cache_scalar  s*    "T.01!!!r'   zdatetimelikes,expected_valuesrf   z
2012-07-26ra  z2012 July 26c                 l    [        USS9n[        USS9n[        USS9n[        R                  " XE5        g )Nr2   r-   r   r9  r  r   )r6   datetimelikesexpected_valuesr^   result_seriesexpected_seriess         r%   *test_convert_object_to_datetime_with_cache9TestToDatetime.test_convert_object_to_datetime_with_cache   sB    0 
 $C9 "
 	}>r'   r&   input   r2   r   r   c                 x    [        [        /[        U5      -  SS9n[        X!S9n[        R
                  " XC5        g )Nr   r-   r   )r   r   r|  r   r4   r\   )r6   r&   r  r9   r8   s        r%   *test_to_datetime_converts_null_like_to_nat9TestToDatetime.test_to_datetime_converts_null_like_to_natC  s3    $ 3%#e*,H=U0
v0r'   zdate, format))z2017-20z%Y-%W)	20 Sundayz%W %A)20 Sunz%W %a)z2017-21z%Y-%U)r  z%U %A)r  z%U %ac                     Sn[         R                  " [        US9   [        XS9  S S S 5        g ! , (       d  f       g = f)Nz,Cannot use '%W' or '%U' without day and yearrh   r   r}  )r6   r   rH   r  s       r%   'test_week_without_day_and_calendar_year6TestToDatetime.test_week_without_day_and_calendar_yearY  s+     =]]:S1, 211s   
/
=c                 4   / SQnSn[         R                  " [        US9   [        USS9nS S S 5        [	        [        SSSS	S
[        S S5      S9[        SSSS	S
[        S S5      S9[        /5      n[         R                  " WU5        g ! , (       d  f       Nd= f)N)r  r  20100240r	  rh   r   r9    r   r   r   r   i@8  r   iPF  )	r4   r
  r  r   r   r   r
   r   r5   r6   
ts_stringsr  r8   r9   s        r%   test_to_datetime_coerce&TestToDatetime.test_to_datetime_coercek  s    


 L''SA H=F Bq!R8D%3HIq!R8D%3HI
 	fh/ BAs   B		
Bzstring_arg, format)zMarch 1, 2018z	%B %d, %Y)z
2018-03-01r   outofboundsi'  r  zJanuary 1, 9999c                     X/n[        USUS9n[        [        SSS5      [        /5      n[        R
                  " XV5        g )Nr   rj  r  r   r   )r   r   r   r   r4   r5   )r6   
string_argrH   r  r  r8   r9   s          r%   test_to_datetime_coerce_oob*TestToDatetime.test_to_datetime_coerce_oob~  s@      !.
ZH (4A"6!<=
f/r'   zerrors, expectedr   ry   200622-12-31111111-24-11c                     SS/n[         R                  " [        SSS9   [        X1S9nS S S 5        [         R                  " WU5        g ! , (       d  f       N&= f)Nr  r  ry  Frz  r9  )r4   r
  r}  r   r5   )r6   r{   r9   r  r8   s        r%   #test_to_datetime_malformed_no_raise2TestToDatetime.test_to_datetime_malformed_no_raise  sS     %n5
''7QV
 !;F
 	fh/	
 
s   
A		
Ac                     SS/nSn[         R                  " [        US9   [        R                  " [
        SS9   [        USS9  S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nr  r  zParsed string "200622-12-31" gives an invalid tzoffset, which must be between -timedelta\(hours=24\) and timedelta\(hours=24\), at position 0rh   ry  r  r9  rk   rl   rm   r4   r
  r}  r   )r6   r  r  s      r%    test_to_datetime_malformed_raise/TestToDatetime.test_to_datetime_malformed_raise  su    $n5
 	
 ]]
 ++#; "	
 
 	
 
s"   A'AA'
A$	 A''
A5c                    Sn[        U5      n[        U5      nX#:X  d   e[        [        U5      /S-  5      n[        U/S-  5      n[        R                  " X#5        [        U/S-  5      n[        R                  " X#5        g )N2015-11-18 15:30:00+05:30rf   )r   r   r   r4   r5   )r6   ts_strr8   r9   s       r%   &test_iso_8601_strings_with_same_offset5TestToDatetime.test_iso_8601_strings_with_same_offset  sz    ,V$V$!!! )F"3!4q!89fX\*
f/x!|,
f/r'   c                 r   SS[         /nSn[        R                  " [        US9   [	        U5      nS S S 5        [
        R                  " [        SSSSS	[        S S
5      S9[        SSSSS	[        S S5      S9[         /[        S9n[        U5      n[        R                  " WU5        g ! , (       d  f       N}= f)Nr  2015-11-18 16:30:00+06:30r	  rh   r     rB  r  r   iXM  r      ih[  r-   )r   r4   r
  r  r   r0   r1   r   r
   r2   r   r5   r  s        r%   ,test_iso_8601_strings_with_different_offsets;TestToDatetime.test_iso_8601_strings_with_different_offsets  s    13NPST
K''SA ,F B88r2r2htU6KLr2r2htU6KL
 
 ?
fh/ BAs   B((
B6c           	          SS[         /n[        USS9n[        [        SSSS5      [        SSSS5      [         /S	S
9n[        R
                  " X#5        g )Nr  r  Tr  r  r  rB  r   r   r   )r   r   r   r   r4   r5   )r6   r  r8   r9   s       r%   0test_iso_8601_strings_with_different_offsets_utc?TestToDatetime.test_iso_8601_strings_with_different_offsets_utc  sY    13NPST
ZT2 tRR()D"b"*EsKPU
 	f/r'   c                 $  ^^ S[        S5      SSS SS/m[        T5      m[        UU4S j[        [	        T5      5       5       5      (       d   e[        S5      n[        S5      nSn[
        R                  " [        US	9   [        T5      nS S S 5        [        S
[        S5      [        S5      R                  5       [        S5      R                  5       S /[        S9n[
        R                  " WS S U5        XR                  S   -
  R                  5       S::  d   eX$R                  S   -
  R                  5       S::  d   e[        R                  " [         SS	9   [        U5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nrj   z
1990-01-01z2015-03-14T16:15:14.123-08:00z2019-03-04T21:56:32.620-07:00r  r  c              3   8   >#    U  H  nTU   TU   L v   M     g 7fra  r&  ).0rS  r^   rL  s     r%   	<genexpr>PTestToDatetime.test_mixed_offsets_with_native_datetime_raises.<locals>.<genexpr>  s      ?.>3q6T!W$.>s   r	  rh   r   r-   rJ  g?zTz-aware datetime.datetime)r   r   allranger|  r4   r
  r  r   rc  r2   r\   r  r  rk   rl   rm   )r6   r  r  r  rI  r9   r^   rL  s         @@r%   .test_mixed_offsets_with_native_datetime_raises=TestToDatetime.test_mixed_offsets_with_native_datetime_raises  sb    l#++
 Tl?eCI.>?????'"K''SA$E B,'9:HHJ9:HHJ 	
 	uSbz84 jjn$335<<<

2&5573>>>]]:-IJ KJ% BA$ KJs    E0F0
E>
Fc                     [        S/S-  5      n[        [        SSSS[        [	        SS95      S	9/S-  5      n[
        R                  " X5        g )
Nr  rf   r  r   r   r      r   r   )r   r   r   r   r   r4   r5   r   s      r%   #test_non_iso_strings_with_tz_offset2TestToDatetime.test_non_iso_strings_with_tz_offset  sR    ;<q@A dAq"Xi6L-MNORSS
 	f/r'   zts, expectedz
2018-01-01r   r  z2018-01-01 08:00c                 &    [        USS9nX2:X  d   eg )NTr  r   )r6   r  r9   r8   s       r%   test_timestamp_utc_true&TestToDatetime.test_timestamp_utc_true  s     RT*!!!r'   dt_str)00010101130001013000010199990101c                     Sn[         R                  " [        US9   [        USS9  S S S 5        g ! , (       d  f       g = f)N"Out of bounds nanosecond timestamprh   rX   r   rk   rl   r   r   )r6   r  r  s      r%   *test_to_datetime_with_format_out_of_bounds9TestToDatetime.test_to_datetime_with_format_out_of_bounds  s.     3]].c:x0 ;::   0
>c                     [         R                  " [        S5      /[        S9n[	        USS9nUR
                  [        R                  L d   eg )Nz2012-06-13T01:39:00Zr-   Tr  )r0   r1   r	   r2   r   r   r   r  )r6   r7   r8   s      r%   test_to_datetime_utc#TestToDatetime.test_to_datetime_utc$  s=    hh456fESd+yyHLL(((r'   c           	          SSK Jn  U" SS5      n[        SSSUS9[        SSSUS9[        SSS	US9/n[        U5      nUR                  U:X  d   eg )
Nr   )r3  i\z-07:00r   r   r   rf   r   )-pandas.tests.indexes.datetimes.test_timezonesr3  r   r   r   )r6   r3  	fixed_offr   r8   s        r%   test_to_datetime_fixed_offset,TestToDatetime.test_to_datetime_fixed_offset*  sb    Mh/	 T1a	2T1a	2T1a	2

 U#yyI%%%r'   r   z2020-10-26 00:00:00+06:00z2020-10-26 00:00:00+01:00r?  rB  zAustralia/Melbourner   c                     Sn[         R                  " [        US9   [        USS9  S S S 5        g ! , (       d  f       g = f)Nr	  rh   Fr  r4   r
  r  r   )r6   r   r  s      r%   8test_to_datetime_mixed_offsets_with_utc_false_deprecatedGTestToDatetime.test_to_datetime_mixed_offsets_with_utc_false_deprecated7  s1     L''SA%( BAAr  r&  )er'  r(  r)  r*  rk   r+  filterwarningsr<  rF  rP  r,  rX  r"   r   r   rl  rp  r   r   ru  ry  r~  r  r   r  r  r  r0  skip_if_windowsr   r  r  r  r  r  r  r  r  r0   r  r  r  r  
skip_ubsanr  r  r  r  r  r  r   r.  listr1   r:  r>  rA  rG  rL  rT  rX  r^  boolr   ra  re  rr  ru  r  tupler   r  r  r  r  rj   r   r  r   r   r  r  r  r   r  r2   r  r  r  r  r  r  r  r  r  r  r  r2  r   r  r4  r&  r'   r%   r6  r6  K  s   [[ ?@? A?,-1 [[:z*M0J  -- [[	 56!#34  
 [[LL,.IJ02MN/ , LL,.IJ02MN / LL,.IJ02MN/ ; LL&(CD02MN/ A7$	
'P [[	:;
0	Q'b
0 [[	 56!#34  
 [[	:;0	0, [[LL%!"<M!"<M &
 LL%!"<M!"<M *
	
6
076
0 [[LL%U/ " LL%U/ &	
*0+*0 [[	 56!#34  
 [[LL,.IJ?	
 [[	:;;	$;.( [[XdBAq%ABXdAq!Q%?@XdAq!Q%?@	
44 [[[s	
vn [[X'DE> Fovp> [[TD,#78 9 [[[65/:[[UT5M2[[TD,#784 9 3 ; 4*//8
 ) )  [[T$6
#CD+ E +2 [[UUG$45 6 [[	
 [[	
== [[r}}\*BMM,,GH== [[&&	
00 [[r}}\*BMM,,GH [[X'DE	 F	 [[	F 	F [[Vc3Z0*0 1*0X")00>
00, [[+M"=!XX}%V		
** [[	*?E JK	*?E JK	
""
11 [[5:	
11$0L [[UT5M2E 3E
& [[UT;$78 9 [[X'DEH FH [[WsJ&78[[Xj'9:> ; 9>* [[W'<&=>[[Xj'9:B ; ?B" [[	se
|/EG [[X'=>$C ?$CL [[UT4L1[[X(94'@A[[]T5"((E5,QR0 S B 200 [[UT4L1[[X(94'@A1 B 21" [[' rvv#*:!::*Q./
 y./3&;K2KKi-.#:J1JJ
 &++,!9\#:;< *Q./\*Il,CDE		
(?)(? [[WtUm4[[C52:+8<C52:+8<D6B;D6B;B4"9B4"9BEE7R< BEE7R< BFF8b=!BFF8b=!	
1 5 1 [[	

-
-0& [[	')CD [[T1a q!MM,'	
	0		0 [[uc3Z()unn=VLM	
00(00$0%N0 [[|$i&GH,<8,7	
	"	"
 [[X'WX1 Y1)& [[(*EF()L\*RS+q!R>S0TU	

)
)r'   r6  c            	       
   \ rS rSr\R
                  R                  SSS/5      \R
                  R                  SS\" S5      /5      S 5       5       r\R
                  R                  SSS/5      S 5       r	S	 r
S
 rS rS rS r\R
                  R                  S/ SQ5      S 5       r\R
                  R                  S/ SQ5      \R
                  R                  SSS/5      S 5       5       r\R
                  R                  S/ SQ/ SQ\// SQ/ SQS//5      S 5       r\R
                  R                  S\" S5      S S!/S S!\" S5      //5      S" 5       rS# rS$ rS% r\R
                  R                  S\\/5      S& 5       r\R
                  R                  S'\\R8                  /5      S( 5       rS) rS* r\R
                  R                  S+S,S-/5      S. 5       r \R
                  R                  S+S,S-/5      S/ 5       r!S0 r"S1r#g)2TestToDatetimeUnitiI  r  YMitem   c                    [        X2S9n[        U/SS9n[        U/X!S9n[        R                  " Xv5        [        [
        R                  " U/[        S9X!S9n[        R                  " Xv5        [        [
        R                  " U/5      X!S9n[        R                  " Xv5        [        [
        R                  " U[
        R                  /5      X!S9nUR                  5       S   (       d   e[        R                  " US S U5        g )Nr  r   r-   r  r&   r   )
r   r   r   r4   r5   r0   r1   r2   rj   r   )r6   r&   r  r  r$   r  r9   r8   s           r%   'test_to_datetime_month_or_year_unit_int:TestToDatetimeUnit.test_to_datetime_month_or_year_unit_intJ  s     t' "X6dV$<
f/RXXtfF;$T
f/RXXtf-DF
f/ RXXtRVVn5DN{{}Q
fRaj(3r'   c                    SnSU S3n[         R                  " [        US9   [        S/USS9  S S S 5        [         R                  " [        US9   [        [        R
                  " S/5      USS9  S S S 5        [         R                  " [        US9   [        R                  " [        US9   [        S/USS9  S S S 5        S S S 5        [         R                  " [        US9   [        S/US	S9  S S S 5        [        S/US
S9n[        [        /SS9n[        R                  " XV5        [        R                  " [        US9   [        S/US
S9nS S S 5        [        R                  " XV5        [        S/US9n[        S/US9n[        R                  " XV5        g ! , (       d  f       GNq= f! , (       d  f       GNA= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       N= f)Nz*strings will be parsed as datetime stringsz(Conversion of non-round float with unit=z is ambiguousrh         ?r  r  r{   z1.5ry   r   r   r-         ?r  r   )rk   rl   rm   r   r0   r1   r4   r
  r  r   r   r5   )r6   r&   r  warn_msgr  r;  r9   s          r%   3test_to_datetime_month_or_year_unit_non_round_floatFTestToDatetimeUnit.test_to_datetime_month_or_year_unit_non_round_float_  s   
 @8mL]]:S1D9 2]]:S1#d7C 2]]:S1++MJUG$w? K 2 ]]:S1D: 2 3%d8<#h/
c,''XFugDBC G
c, 3%d+s.
c,1 2111 KJ 21 21 GFsS   F!F+G,F=9G"G!G2
F(+
F:=
G	G
G!
G/2
H c                     Sn[         R                  " [        US9   [        S/SSUS9  S S S 5        g ! , (       d  f       g = f)Nz#cannot specify both format and unitrh   r   r  rX   )r  rH   r&   r}  r]  s      r%   	test_unitTestToDatetimeUnit.test_unit  s3     4]]:S1#heD 211	   3
Ac                     [         R                  " [        5         [        S/SSS9nS S S 5        [        S/SSS9n[         R                  " WU5        g ! , (       d  f       N2= f)N
1704660000r  unixr  origini ert  )r6   r&   r;  r9   s       r%   test_unit_str TestToDatetimeUnit.test_unit_str  sP     ''6|n3vFC 7
|#fE
c8, 76s   A
A"c           
         SSS[         [        [        R                  SS/n[	        USSUS9n[        S[        S	5      [        S	5      [        [        [        [        [        /[        S
9n[        R                  " X45        [	        USSUS9n[        / SQSS
9n[        R                  " X45        Sn[        R                  " [        US9   [	        USSUS9  S S S 5        g ! , (       d  f       g = f)Nl   qMe;r   r  r   r   r  ry   r  r{   r&   
1970-01-02r-   r   )r   r  r  r   r   r   r   r   r   z8cannot convert input 11111111111111111 with the unit 'D'rh   r  )r   r   r0   rj   r   r   r   r2   r4   r5   r   rk   rl   r   r6   r&   rK   r8   r9   r  s         r%   test_unit_array_mixed_nans-TestToDatetimeUnit.test_unit_array_mixed_nans  s    #QT3rJV#heL!,','	 
 	f/V#heL R
 	f/H]].c:SF ;::s   C
C,c                    S[         [        [        R                  S/n[	        USSUS9n[        S[        [        [        [        /[        S9n[        R                  " X45        [	        USSUS9n[        / SQS	S9n[        R                  " X45        S
n[        R                  " [        US9   [	        USSUS9  S S S 5        g ! , (       d  f       g = f)Nl     #0U.KK% r   ry   r  r{   r  r&   r-   r   )r   r   r   r   r   r   z@cannot convert input 1420043460000000000000000 with the unit 's'rh   r  )r   r   r0   rj   r   r   r2   r4   r5   r   rk   rl   r   r  s         r%   $test_unit_array_mixed_nans_large_int7TestToDatetimeUnit.test_unit_array_mixed_nans_large_int  s    +T3FVH3eL3S#sCHPVW
f/VH3eL !DHU
f/P]].c:wSF ;::s   ,C
Cc                     Sn[         R                  " [        US9   [        SSSUS9  S S S 5        g ! , (       d  f       g = f)Nz+non convertible value foo with the unit 's'rh   r!  r  r  r  r}  r]  s      r%   8test_to_datetime_invalid_str_not_out_of_bounds_valuerrorKTestToDatetimeUnit.test_to_datetime_invalid_str_not_out_of_bounds_valuerror  s1     <]]:S1gCuE 211	   2
A errorr  c                 l    [        S5      n[        SSX!S9nXC:X  d   e[        U[         5      (       d   eg )Nz1970-05-09 14:25:11iǊ r  r  )r   r   r:  )r6   r&   r   r9   r8   s        r%   test_unit_consistency(TestToDatetimeUnit.test_unit_consistency  s<     23XCK!!!&),,,,r'   r{   )ry   r  r   r.   float64r  c                     [        SS/SS9n[        R                  " SS/5      R                  U5      n[	        XRUS9n[
        R                  " Xd5        g )N2015-06-19 05:33:202015-05-27 22:33:20r   r-   @CA5Cr  )r   r0   r1   r  r   r4   r5   )r6   r&   r{   r.   r9   r7   r8   s          r%   test_unit_with_numeric)TestToDatetimeUnit.test_unit_with_numeric  sS    
 !"$9:(
 hh[1299%@Su=
f/r'   zexp, arr, warning)r   r&  r'  )r!  r(  r)  )r&  r'  r   r   )r(  r)  r!  r   Nc                     [        USS9n[        R                  " USS9   [        USUS9nS S S 5        [        R                  " WU5        g ! , (       d  f       N&= f)Nr   r-   ry  rh   r   r  )r   r4   r
  r   r5   )r6   r&   r   r7   warningr9   r8   s          r%   test_unit_with_numeric_coerce0TestToDatetimeUnit.test_unit_with_numeric_coerce  sO    $ !H5''7OP XUCF Q
fh/ QPs   A
Ar7   r[  r(  r)  c                    [        U Vs/ s H  n[        U5      PM     snSS9n[        USUS9n[        R                  " XT5        [        USUS9n[        R                  " XT5        [        U5      n[        R                  " XT5        g s  snf )Nr   r-   r   r  r  )r   r   r   r4   r5   r   )r6   r&   r7   r_   r9   r8   s         r%   test_unit_mixed"TestToDatetimeUnit.test_unit_mixed  sz     41)A,4HES?
f/ S>
f/s#
f/ 5s   B	c                 d    Sn[        USUS9n[        S5      nX4:X  d   e[        USS9nXS:X  d   eg )Ng aAr  r  z2015-06-19 19:55:31.877000093r  rP   )r6   r&   r   r8   r9   alts         r%   test_unit_rounding%TestToDatetimeUnit.test_unit_rounding  sD     #UE:<=!!!C(}}r'   c                 d    [        S/S-  SS9n[        USSUS9n[        R                  " X25        g )Ng   Brf   r#  r"  ry   r  r  )r   r   r4   r5   r6   r&   r9   r8   s       r%   test_unit_ignore_keeps_name.TestToDatetimeUnit.test_unit_ignore_keeps_name  s2    $!&1XhSN
f/r'   c                 `    [        S/SSSS9n[        S/SS9n[        R                  " X5        g )	Nr   r  Try   )r  r  r{   1970-01-01 00:00:01rJ  r-   r  r   s      r%   'test_to_datetime_errors_ignore_utc_true:TestToDatetimeUnit.test_to_datetime_errors_ignore_utc_true  s2    aSsXF "7!8N
f/r'   c           
      6   Sn[        [        S5       Vs/ s H  o2U-   PM	     sn5      R                  U5      n[        USS9n[        [        S5       Vs/ s H  n[	        S5      [        US9-   PM     snSS9n[        R                  " XV5        g s  snf s  snf 	NQr  r  r  2013-06-09 02:42:28secondsr   r-   )r   r  r  r   r   r   r4   r\   )r6   r.   epochtr^   r8   r9   s          r%   test_to_datetime_unit(TestToDatetimeUnit.test_to_datetime_unit  s    r3Aai34;;EBSs+ r"A /09Q3GG" 
 	v0 4s   BBnullc           
      0   Sn[        [        S5       Vs/ s H  o2U-   PM	     snU/-   5      n[        USS9n[        [        S5       Vs/ s H  n[        S5      [	        US9-   PM     sn[
        /-   SS9n[        R                  " XV5        g s  snf s  snf r@  )r   r  r   r   r   r   r4   r\   )r6   rI  rE  rF  r^   r8   r9   s          r%    test_to_datetime_unit_with_nulls3TestToDatetimeUnit.test_to_datetime_unit_with_nulls*  s    r3Aai3tf<=Ss+NSTViXiY,-	!0DDiXe

 	v0 4 Ys   B
Bc           
         Sn[        [        R                  " SSS5       Vs/ s H  o!U-   PM	     sn[        /-   5      R	                  [
        5      n[        USS9n[        [        R                  " SSS5       Vs/ s H  n[        S5      [        US9-   PM     sn[        /-   S	S
9nUR                  S5      n[        R                  " XE5        g s  snf s  snf )NrA  r   rf   g      ?r  r  rB  rC  r   r-   ms)r   r0   aranger   r  rc   r   r   r   r   roundr4   r\   )r6   rE  rF  r^   r8   r9   s         r%   (test_to_datetime_unit_fractional_seconds;TestToDatetimeUnit.test_to_datetime_unit_fractional_seconds6  s    1a)>?)>Aai)>?4&HIPPQVWSs+ 1a..A /09Q3GG. e	
 
 d#
v0 @s   C;Cc                     [        SSS[        [        R                  /SS9n[	        [        S5      [        S5      /S/S-  -   S	S
9n[        R                  " X5        g )Nr   rf   r   r  r  r  
1970-01-03r   r   r-   )r   r   r0   rj   r   r   r4   r5   r   s      r%   test_to_datetime_unit_na_values2TestToDatetimeUnit.test_to_datetime_unit_na_valuesG  sW    aE37cB |$i&=>%1L
 	f/r'   bad_valr!  ikc                     U S3n[         R                  " [        US9   [        SSU/SS9  S S S 5        g ! , (       d  f       g = f)Nz with the unit 'D'rh   r   rf   r  r  r}  )r6   rW  r  s      r%   test_to_datetime_unit_invalid0TestToDatetimeUnit.test_to_datetime_unit_invalidO  s9    	+,]]:S1Awc2 211s	   6
Ac                     [        [        S5      [        S5      /S/S-  -   SS9n[        SSU/SS	S
9n[        R                  " X25        g )Nr  rT  r   r   r   r-   rf   r  r   r  rK  )r6   rW  r9   r8   s       r%   test_to_timestamp_unit_coerce0TestToDatetimeUnit.test_to_timestamp_unit_coerceU  sR     !|$i&=>%1L
 aG_3xH
f/r'   c                    SnSnSU-  n[        SUS-
  U* S-   /[        S9nXB-  R                  [        R                  5      nS H{  n[        USUS	9n[        R                  " UR                  [        R                  5      R                  [        R                  5      UR                  [        R                  5      S
S9  M}     [        SUS-   /[        S9n[        SU* S-
  /[        S9n	[        R                  " [        US9   [        USSS	9  S S S 5        [        R                  " [        US9   [        U	SSS	9  S S S 5        g ! , (       d  f       N<= f! , (       d  f       g = f)Nz"cannot convert input with unit 'D'g  S$Bl            r   g{Gzt?r-   r  r  r  g|=)rtolrh   r  )r   rc   r  r0   r  r   r4   assert_almost_equalr$  rk   rl   r   )
r6   r  oneday_in_nstsmax_in_daysshould_succeedr9   
error_moderesult1should_fail1should_fail2s
             r%   (test_float_to_datetime_raise_near_bounds;TestToDatetimeUnit.test_float_to_datetime_raise_near_bounds_  s.   2),%~'=>e
 #199"((C7J!.s:NG ""rxx(//

;

+	 8 q-%"78Fq=.5"89G]].c:3w? ;]].c:3w? ;: ;:::s   E1E
E
E%r&  )$r'  r(  r)  r*  rk   r+  r,  rc   r  r  r  r  r  r  r  r"  r*  r}  r.  r   r1  r5  r9  r=  intrG  r   r0   rj   rK  rQ  rU  rY  r\  rh  r4  r&  r'   r%   r  r  I  s]   [[Vc3Z0[[Vc5:%674 8 14& [[Vc3Z0- 1-@E-G:GF [[W&CD- E- [[X'DE[[Wy'&:;0 < F0 [[ F1 M8	
00 [[z"K=+y'<=	
00"	00 [[WsEl31 41 [[VdBFF^4	1 5	11"0 [[Y	(:;3 <3
 [[Y	(:;0 <0@r'   r  c                   >   \ rS rSr\R
                  S 5       rS rS r\R                  R                  SSSSS	S
SS.SSSSSSS./5      S 5       rS rS rS rS r\R                  R                  SS/SS// SQSS// SQ/5      S 5       rS rS rS rS rS  rS!rg")#TestToDatetimeDataFramei{  c                 P    [        SS/SS/SS/SS/S	S
/SS/SS/SS/SS/S.	5      $ )Nr    rf   r   r   rW   r(     :   ;   r   r  r   	r#  r$  r%  r&  r'  secondrN  usr  )r   r6   s    r%   dfTestToDatetimeDataFrame.df|  sS    tQ1vAr(r(!f!f!f

 	
r'   c                    [        US   US   US   S.US9n[        [        S5      [        S5      /5      n[        R                  " X45        [        U/ SQ   R                  5       US9n[        R                  " X45        g )Nr#  r$  r%  r#  r$  r%  r   20150204 00:00:00z20160305 00:0:00)r   r   r   r4   r\   to_dictr6   rv  r&   r8   r9   s        r%   test_dataframe&TestToDatetimeDataFrame.test_dataframe  s    Z"W+biHPU
 *+Y7I-JK
 	v0 R 89AAC5Q
v0r'   c                     U/ SQ   R                  5       nSUS'   [        X2S9n[        [        S5      [        S5      /5      n[        R
                  " XE5        g )Nry  rf   r$  r   rz  z20160205 00:0:00)r{  r   r   r   r4   r\   )r6   rv  r&   df2r8   	expected2s         r%   &test_dataframe_dict_with_constructable>TestToDatetimeDataFrame.test_dataframe_dict_with_constructable  sW    )*224GS.*+Y7I-JK
	 	v1r'   r  yearsmonthsdaysrA  r   rD  )r#  r$  r%  r&  r'  rs  r#  r$  r%  r&  r'  rs  c                     [        U[        UR                  5       5         R                  US9US9n[	        [        S5      [        S5      /SS9n[        R                  " XE5        g )Ncolumnsr   z20150204 06:58:10z20160305 07:59:11r   r-   )r   r  keysrenamer   r   r4   r\   )r6   rv  r&   r  r8   r9   s         r%   *test_dataframe_field_aliases_column_subsetBTestToDatetimeDataFrame.test_dataframe_field_aliases_column_subset  s_    . RTYY[ 1299$9GuU*+Y7J-KL
 	v0r'   c           
          SSSSSSSSS	S
.	n[        UR                  US9US9n[        [        S5      [        S5      /5      n[        R
                  " XE5        g )Nr#  r$  r%  r&  r'  rs  rN  rt  r  rr  r  r   20150204 06:58:10.00100200320160305 07:59:11.001002003)r   r  r   r   r4   r\   )r6   rv  r&   dr8   r9   s         r%   test_dataframe_field_aliases4TestToDatetimeDataFrame.test_dataframe_field_aliases  sn    

 RYYqY1?7878
 	v0r'   c                     [        UR                  [        5      US9n[        [	        S5      [	        S5      /5      n[
        R                  " X45        g )Nr   r  r  )r   r  r[   r   r   r4   r\   r|  s        r%   test_dataframe_str_dtype0TestToDatetimeDataFrame.test_dataframe_str_dtype  sG    RYYs^597878
 	v0r'   c                     [        SS/SS/SS/S.5      nSn[        R                  " [        US	9   [	        X!S
9  S S S 5        [	        USUS9n[        [        S5      [        /5      n[        R                  " XE5        g ! , (       d  f       NJ= f)Nr  rn  rf   r  r   rW   ry  z^^cannot assemble the datetimes: time data ".+" doesn\'t match format "%Y%m%d", at position 1\.rh   r   r   r  rz  )
r   rk   rl   rm   r   r   r   r   r4   r\   )r6   r&   r  r  r8   r9   s         r%   test_dataframe_coerce-TestToDatetimeDataFrame.test_dataframe_coerce  s    $BAOP6 	 ]]:S1) 2 S?9%893?@
v0 21s   
A??
Bc                     Sn[         R                  " [        US9   UR                  5       nSUS'   [	        XBS9  S S S 5        g ! , (       d  f       g = f)Nz?extra keys have been passed to the datetime assemblage: \[foo\]rh   r   r!  r   )rk   rl   rm   copyr   )r6   rv  r&   r  r  s        r%   !test_dataframe_extra_keys_raisesm9TestToDatetimeDataFrame.test_dataframe_extra_keys_raisesm  s=    P]]:S1'')CCJ) 211s   A
Acols)r#  r$  rs  )r#  r%  rs  c                     Sn[         R                  " [        US9   [        X   US9  S S S 5        g ! , (       d  f       g = f)Nz`to assemble mappings requires at least that \[year, month, day\] be specified: \[.+\] is missingrh   r   r}  )r6   rv  r&   r  r  s        r%   "test_dataframe_missing_keys_raises:TestToDatetimeDataFrame.test_dataframe_missing_keys_raises  s4    5 	 ]]:S1. 211r  c                 v   Sn[        SS/SS/SS/S.5      n/ S	QUl        [        R                  " [        US
9   [        X1S9  S S S 5        [        SS/SS/SS/SS/S.5      n/ SQUl        [        R                  " [        US
9   [        X1S9  S S S 5        g ! , (       d  f       N[= f! , (       d  f       g = f)Nz#cannot assemble with duplicate keysr  rn  rf   r  r   rW   ry  )r#  r#  r%  rh   r   )r#  r$  r%  r&  )r#  r$  r%  r%  )r   r  rk   rl   rm   r   )r6   r&   r  r  s       r%   'test_dataframe_duplicate_columns_raises?TestToDatetimeDataFrame.test_dataframe_duplicate_columns_raises	  s    3$BAOP-]]:S1) 2 D\QGQFQPQFS
 6]]:S1) 21 21 21s   
B
B*
B'*
B8c                     [        SS/SS/SS/S.5      n[        UR                  S5      US	9n[        [	        S
5      [	        S5      /5      n[
        R                  " X45        g )Nr  rn  rf   r   r   rW   ry  int16r   rz  20160305 00:00:00)r   r   r  r   r   r4   r\   r6   r&   rv  r8   r9   s        r%   test_dataframe_int16,TestToDatetimeDataFrame.test_dataframe_int16	  sd    t1vq!fMN RYYw/u=*+Y7J-KL
 	v0r'   c                    [        SS/SS/SS/S.5      nUS   R                  S	5      US'   US
   R                  S	5      US
'   [        X!S9n[        [	        S5      [	        S5      /5      n[
        R                  " X45        g )Nr  rn  rf   r   r   rW   ry  r$  int8r%  r   rz  r  )r   r  r   r   r   r4   r\   r  s        r%   test_dataframe_mixed,TestToDatetimeDataFrame.test_dataframe_mixed&	  s    t1vq!fMNk((07uI$$V,5	R-*+Y7J-KL
 	v0r'   c                     [        SS/SS/SS/S.5      nSn[        R                  " [        US9   [	        X!S9  S S S 5        g ! , (       d  f       g = f)	Nr   r   r  r   ry  zk^cannot assemble the datetimes: unconverted data remains when parsing with format ".*": "1", at position 0.rh   r   )r   rk   rl   rm   r   )r6   r&   rv  r  s       r%   test_dataframe_float,TestToDatetimeDataFrame.test_dataframe_float1	  sM    tQxAOP5 	 ]]:S1( 211s   
A
Ac                     [        SS/SS/SS/S.5      n[        USS	9n[        [        R                  " S
S/SS95      R
                  R                  S5      n[        R                  " X#5        g )Nr  rn  rf   r   r   rW   ry  Tr  z
2015-02-04z
2016-03-05r  r-   r   )	r   r   r   r0   r1   r   tz_localizer4   r\   )r6   rv  r8   r9   s       r%   test_dataframe_utc_true/TestToDatetimeDataFrame.test_dataframe_utc_true;	  sj    t1vq!fMNRT*HHlL19IJ

"[[ 	 	v0r'   r&  N)r'  r(  r)  r*  rk   fixturerv  r}  r  r+  r,  r  r  r  r  r  r  r  r  r  r  r  r4  r&  r'   r%   rl  rl  {  s    ^^
 
12 [[  !##  ""	
*1+*11,	11* [[HW'e%	
	/	/*	1	1)1r'   rl  c                      \ rS rSrS r\R                  R                  SSS/SS//5      S 5       r\R                  R                  S/ S	Q5      \R                  R                  S
SS/5      S 5       5       r	\R                  R                  S/ SQ5      S 5       r
\R                  R                  S/ SQ5      S 5       r\R                  R                  S/ SQ5      S 5       r\R                  R                  S/ SQ5      S 5       r\R                  R                  S/ SQ5      S 5       r\R                  R                  S/ SQ5      S 5       rS r\R                  R#                  SS9S 5       rS rS r\R,                  S  5       rS! r\R,                  \R                  R                  S"/ S#Q5      S$ 5       5       rS% rS& rS' rS( rS) r\R                  R                  S*\" S+5      \ " S+5      /5      S, 5       r!S- r"S. r#S/ r$S0 r%S1 r&S2 r'S3 r(S4 r)S5 r*\R                  R                  S6/ S7Q5      S8 5       r+S9 r,S: r-S; r.\R                  R                  S<\/\0Rb                  /5      S= 5       r2S>r3g?)@TestToDatetimeMisciE	  c                     [         R                  " S/[        S9nSn[        R                  " [
        US9   [        U5        S S S 5        g ! , (       d  f       g = f)Nz2262-04-11 23:47:16.854775808r-   z6^Out of bounds nanosecond timestamp: .*, at position 0rh   )r0   r1   r2   rk   rl   r   r   )r6   r7   r  s      r%   %test_to_datetime_barely_out_of_bounds8TestToDatetimeMisc.test_to_datetime_barely_out_of_boundsF	  s@     hh78GF]].c: ;::s   A
Azarg, exp_str2012-01-01 00:00:0020121001z
2012-10-01c                 F    [        U/US9n[        U5      nUS   U:X  d   eg )Nr   r   rP   )r6   r&   rQ   exp_strr8   r   s         r%   test_to_datetime_iso8601+TestToDatetimeMisc.test_to_datetime_iso8601P	  s.     cU%0 ayCr'   zinput, format))2012%Y-%m)z2012-01r   )
2012-01-01r   )2012-01-01 10r   )2012-01-01 10:00r   )2012-01-01 10:00:00r   )z2012-01-01 10:00:00.123r   r   r   r   TFc                     [         R                  " [        SU SU S3S9   [        XUS9  S S S 5        g ! , (       d  f       g = f)Ntime data \"z\" doesn't match format \"\", at position 0rh   r   r}  )r6   r  rH   r   s       r%   test_to_datetime_iso8601_fails1TestToDatetimeMisc.test_to_datetime_iso8601_fails\	  sH    " ]]w 'X.0
 E:
 
 
s	   5
A)r  r  )r  r   )r  r   )r  r   r  c                     SR                  S[         S3S[         S3/5      n[        R                  " [        US9   [        XS9  S S S 5        g ! , (       d  f       g = f)Nr  r  r  z:^time data ".*" doesn't match format ".*", at position 0. rh   r   r  )r6   r  rH   r  s       r%   $test_to_datetime_iso8601_exact_fails7TestToDatetimeMisc.test_to_datetime_iso8601_exact_failsv	  sg     hh$$3#4A7M"#1&
 ]]
 -	
 
 
s   
A
A)r  )z2012-01-01 00r   )z2012-01-01 00:00r   )r  r   c                 @    [        SSS5      n[        XSS9nXC:X  d   eg )Nr   r   Fr   r   r   r6   r  rH   r9   r8   s        r%   "test_to_datetime_iso8601_non_exact5TestToDatetimeMisc.test_to_datetime_iso8601_non_exact	  s*     T1a(U?!!!r'   ))2020-01z%Y/%m)rW  z%Y/%m/%d)2020-01-01 00z%Y/%m/%dT%H)2020-01-01T00z%Y/%m/%d %H)2020-01-01 00:00z%Y/%m/%dT%H:%M)2020-01-01T00:00z%Y/%m/%d %H:%M)2020-01-01 00:00:00z%Y/%m/%dT%H:%M:%S)2020-01-01T00:00:00z%Y/%m/%d %H:%M:%Sc                     [         R                  " [        SU SU S3S9   [        XS9  S S S 5        g ! , (       d  f       g = f)Nr  z\" doesn\'t match format \"r  rh   r   r}  )r6   r  rH   s      r%   "test_to_datetime_iso8601_separator5TestToDatetimeMisc.test_to_datetime_iso8601_separator	  sF     ]]w 'X.0
 -
 
 
s	   
4
A))r  r  )rW  r   )r  r   )r  %Y-%m-%dT%H)r  r   )r  %Y-%m-%dT%H:%M)r  r   )r  %Y-%m-%dT%H:%M:%S)z2020-01-01T00:00:00.000%Y-%m-%dT%H:%M:%S.%f)z2020-01-01T00:00:00.000000r  )z2020-01-01T00:00:00.000000000r  c                 >    [        SSS5      n[        XS9nXC:X  d   eg Nr?  r   r   r  r  s        r%   test_to_datetime_iso8601_valid1TestToDatetimeMisc.test_to_datetime_iso8601_valid	  (    $ T1a(U2!!!r'   ))z2020-1r  )z2020-1-1r   )z
2020-1-1 0r   )z
2020-1-1T0r  )z2020-1-1 0:0r   )z2020-1-1T0:0r  )z2020-1-1 0:0:0r   )z2020-1-1T0:0:0r  )z2020-1-1T0:0:0.000r  )z2020-1-1T0:0:0.000000r  )z2020-1-1T0:0:0.000000000r  c                 >    [        SSS5      n[        XS9nXC:X  d   eg r  r  r  s        r%   #test_to_datetime_iso8601_non_padded6TestToDatetimeMisc.test_to_datetime_iso8601_non_padded	  r  r'   ))z#2020-01-01T00:00:00.000000000+00:00z%Y-%m-%dT%H:%M:%S.%f%z)z2020-01-01T00:00:00+00:00%Y-%m-%dT%H:%M:%S%z)z2020-01-01T00:00:00Zr  c                 X    [        SSS[        R                  S9n[        XS9nXC:X  d   eg )Nr?  r   r   r   )r   r2  r   r   r  s        r%   ,test_to_datetime_iso8601_with_timezone_valid?TestToDatetimeMisc.test_to_datetime_iso8601_with_timezone_valid	  s.     T1a9U2!!!r'   c                 @    [        SUS9n[        SSS5      nX#:X  d   eg )N2001r   r   r   r  )r6   r&   rsxps       r%   test_to_datetime_default+TestToDatetimeMisc.test_to_datetime_default	  s%    u-dAq!xxr'   z1fails to enforce dayfirst=True, which would raise)r   c                     Sn[         R                  " [        US9   [        R                  " [
        SS9   [        SSUS9  S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)NzInvalid date specifiedrh   zProvide formatz
01-13-2012Tdayfirstr&   r  r]  s      r%   "test_to_datetime_respects_dayfirst5TestToDatetimeMisc.test_to_datetime_respects_dayfirst	  sW    
 ']]:S1 ++K?OPL4uE Q 21 QP 21s"   A$AA$
A!	A$$
A2c                 X    [        [        SSS95      n[        X!S9nUS   US   :X  d   eg )NrD   r   r  r   r   )r   r   r   )r6   r&   r^   r8   s       r%   %test_to_datetime_on_datetime64_series8TestToDatetimeMisc.test_to_datetime_on_datetime64_series
  s3    Z
B78S.ayCF"""r'   c                    [        / SQ5      nS[         S3n[        R                  " [        US9   [        USUS9  S S S 5        [        USUS9n[        [        SS	S
5      [        SS	S
5      [        /5      n[        R                  " XE5        [        USUS9n[        R                  " Xb5        g ! , (       d  f       Ny= f)N)z
10/18/2006z
10/18/2008 z@^time data " " doesn\'t match format "%m/%d/%Y", at position 2. r  rh   r  r  r   i  r   rB  r  ry   )
r   r  rk   rl   rm   r   r   r   r4   r\   )r6   r&   r^   r  result_coerceexpected_coerceresult_ignores          r%   %test_to_datetime_with_space_in_series8TestToDatetimeMisc.test_to_datetime_with_space_in_series

  s    67./q2 	 ]]:S1G59 2#CF (4R"8(4R:PRU!VW
}>#CF
}2 21s   B00
B>c                     [        / SQ/ SQS9n[        USUS9nUR                  " [        SUS9n[        R                  " XC5        g )N)May 04Jun 02zDec 11r   rf   r   index%b %yrG   r   r   rZ   r4   r\   )r6   r&   r0  r9   r8   s        r%   test_to_datetime_with_apply.TestToDatetimeMisc.test_to_datetime_with_apply
  s?    
 2)Dr'?+gUC
v0r'   c                 ^    [        SSS9n[        SSS5      R                  S5      nX:X  d   eg )Nz2020-01-01 00:00:00UTCz%Y-%m-%d %H:%M:%S%Zr   r?  r   r   )r   r   r  r   s      r%   test_to_datetime_timezone_name1TestToDatetimeMisc.test_to_datetime_timezone_name#
  s5    5>STT1a(44U;!!!r'   r{   r  c                    ^ [        / SQ/ SQS9n[        USUTS9nUR                  " U4S j5      n[        R                  " XT5        g )N)r  r	  r   r
  r  r  rz   c                    > [        U SSTS9$ )Nr  r   rz   r   )r_   r&   s    r%   re  OTestToDatetimeMisc.test_to_datetime_with_apply_with_empty_str.<locals>.<lambda>3
  s    k!GHERr'   r  )r6   r&   r{   r0  r9   r8   s    `    r%   *test_to_datetime_with_apply_with_empty_str=TestToDatetimeMisc.test_to_datetime_with_apply_with_empty_str)
  sC     ,I>r'&NR
 	v0r'   c                 .    [        SUS9nU[        L d   eg Nr   r   )r   r   r6   r&   r8   s      r%   test_to_datetime_empty_stt-TestToDatetimeMisc.test_to_datetime_empty_stt7
  s    Ru-}}r'   c                 \    [        SS/US9n[        U5      R                  5       (       d   eg r  )r   r   r  r  s      r%   test_to_datetime_empty_str_list2TestToDatetimeMisc.test_to_datetime_empty_str_list<
  s+    b"XU3F|!!!!r'   c                 <    [        S5      n[        SUS9nX#:X  d   eg )Nr   r   r  r   s       r%   test_to_datetime_zero(TestToDatetimeMisc.test_to_datetime_zero@
  s#    1q.!!!r'   c                 B    [        S/US9S   n[        SUS9nX2:X  d   eg )Nr  r   r   r   r8  s       r%   test_to_datetime_strings+TestToDatetimeMisc.test_to_datetime_stringsF
  s-    xu5a8V51!!!r'   c                     / SQnU Vs/ s H  n[        X1S9PM     nnU Vs/ s H  n[        U5      PM     nn[        R                  " Xd5        g s  snf s  snf )N)r  20120101z20120101 12:01:01r   )r   r   r4   r`  )r6   r&   r1   r  r9   date_strr8   s          r%   "test_to_datetime_strings_variation5TestToDatetimeMisc.test_to_datetime_strings_variationL
  sP    9CHI5K45I6;<e()H%e<
v0 J<s
   AAr8   r  c                 ,    [        SSS5      nX:X  d   eg )Nr   r   r   r   s      r%   'test_to_datetime_strings_vs_constructor:TestToDatetimeMisc.test_to_datetime_strings_vs_constructorR
  s    T1a(!!!r'   c                    [        SS/SUS9n[        [        R                  " SS/SS95      n[        R
                  " X#5        Sn[        R                  " [        US9   [        SS/S	US9  S S S 5        g ! , (       d  f       g = f)
Nr   1ry   r  Or-   z<^Given date string "1" not likely a datetime, at position 1$rh   r  )	r   r   r0   r1   r4   rI   rk   rl   rm   )r6   r&   r8   r9   r  s        r%   $test_to_datetime_unprocessable_input7TestToDatetimeMisc.test_to_datetime_unprocessable_inputW
  sj     aXheD1c(#67
)L]]:S1C> 211s   A66
Bc                 f    [        S//S-  5      n[        USUS9n[        R                  " X#5        g )Nrh  d   ry   r  r   )r6   r&   seriesr8   s       r%   !test_to_datetime_unhashable_input4TestToDatetimeMisc.test_to_datetime_unhashable_inputb
  s0    ##&VHEB
v.r'   c                     [         R                  " S5      R                  S5      nUR                  S5      n[	        U/5      nUS   UR                  S5      :X  d   e[        U5      nXB:X  d   eg )Nl    `SD& zM8[us]r2  r   )r0   r  viewr  r   r   )r6   r=  as_objr  r   s        r%   'test_to_datetime_other_datetime64_units:TestToDatetimeMisc.test_to_datetime_other_datetime64_unitsg
  se    *+00:s#vh'Qx6==----&!r'   c                     [        SSS9n[        UR                  5      n[        UR                  5      n[        U5      n[
        R                  " X5        g )NrD   r  r  )r   r   rK   r  asi8r4   r5   )r6   rngintsr8   s       r%   !test_to_datetime_list_of_integers4TestToDatetimeMisc.test_to_datetime_list_of_integersr
  sA    R0CJJ'CHH~t$
c*r'   c                     Sn[         R                  " [        US9   [        SSSS9  S S S 5        g ! , (       d  f       g = f)Nz>Cannot cast 139999 days 00:00:00 to unit='ns' without overflowrh   z1/1/1700Br  )startr  r  )rk   rl   r   r   r6   r  s     r%   r<  ,TestToDatetimeMisc.test_to_datetime_overflow|
  s1     O]]/s;Zc6B <;;rc  c                     [         R                  " S/[        S9n[        R                  " [
        SS9   [        USUS9  S S S 5        g ! , (       d  f       g = f)N87156549591102612381000001219H5r-   Unknown datetime string formatrh   r  r  )r0   r1   r2   rk   rl   rm   r   )r6   r&   invalids      r%   test_string_invalid_operation0TestToDatetimeMisc.test_string_invalid_operation
  s@    ((=>fM ]]:-MNu= ONNs   A		
Ac                    [         R                  " SS[         R                  S/[        S9n[         R                  " SSS9n[        U5       H,  u  pE[        U5      (       a
  [        X4'   M  [        U5      X4'   M.     [        R                  " U5      S   n[        R                  " Xc5        [        X!S9n[        U[        5      (       d   e[        R                   " XgR"                  5        g )	NrD   rE   z1/4/2000r-   r   r   r   r   )r0   r1   rj   r2   empty	enumerater   r   r	   r   array_to_datetimer4   r`  r   r:  r   assert_numpy_array_equalrK   )r6   r&   stringsr9   rS  r   r8   rM  s           r%   test_string_na_nat_conversion0TestToDatetimeMisc.test_string_na_nat_conversion
  s     ((J
BFFJGvV88AX.(FACyy"#Cj	 ) ((1!4
v0g3'=1111
##FNN;r'   c                    [         R                  " S[         R                  /[        S9nSn[        R
                  " [        US9   [        USUS9  S S S 5        [        USUS9n[        U[        S9n[        R                  " XE5        [        R
                  " [        US9   [        USUS9  S S S 5        g ! , (       d  f       Nk= f! , (       d  f       g = f)Nz
1/100/2000r-   rL  rh   r  r  ry   )r0   r1   rj   r2   rk   rl   rm   r   r   r4   r5   )r6   r&   	malformedr  r8   r9   s         r%   'test_string_na_nat_conversion_malformed:TestToDatetimeMisc.test_string_na_nat_conversion_malformed
  s    HHlBFF36B	 0]]:S1	'? 2 YxuE&1
f/]]:S1	'? 21 21 21s   B6!C6
C
Cc                    / SQn[        S[        R                  S[        R                  S/USS9n[        [        SUS9[        R                  [        SUS9[        R                  [        SUS9/USS9n[        X1S9n[        XAS9n[        [        R                  " SS	S
9US9n[        S5       HM  nUR                  U   n	[        U	5      (       a  [        UR                  U'   M7  [        XS9UR                  U'   MO     [        R                  " XWSS9  UR                  S:X  d   e[        R                  " XgSS9  UR                  S:X  d   eg )N)rh  rw  cr  erD   rF   z1/5/2000r!  r  r#  r   rW   r   r-   r  F)check_names)r   r0   rj   r   rQ  r  r  r   r   r4   r\   r#  )
r6   r&   idxr7  dseriesr8   dresultr9   rS  r_   s
             r%   'test_string_na_nat_conversion_with_name:TestToDatetimeMisc.test_string_na_nat_conversion_with_name
  s)   'RVVZ@RW
 Je4Je4Je4 

 V1g3"((1H5SAqAAAAww#&a #.q#>a   	vUC{{e###
weD||u$$$r'   r  )hmr  rN  rt  r  c                    [         R                  " SU S35      n[        / SQUS9nUR                  R	                  U5      nUS;   a  Sn[         R                  " SU S35      n[        UR	                  U5      5      nUR                  U:X  d   e[        R                  " [        U5      U5        [        R                  " [        XQS9U5        g )NzM8[])z2000-01-01T00:00z2000-01-02T00:00r   r   )rf  rg  r  )r0   r.   r   rK   r  r   r4   r5   )r6   r&   r  r.   baserK   	exp_dtyper9   s           r%   $test_dti_constructor_numpy_timeunits7TestToDatetimeMisc.test_dti_constructor_numpy_timeunits
  s     3tfA'JRWX##E*:DHHs4&]+	 Y!78~~***
mF3X>
k&>Ir'   c           	      b   / SQn[        [        SSS5      [        SSS5      [        SSS5      /5      n[        USS9n[        [        R                  " U5      SS9n[	        USUS	9n[	        [        R                  " U5      SUS	9n[        [        U5      SS9n[        [        U5      SS9n	[        R                  " X45        [        R                  " X55        [        R                  " X65        [        R                  " X75        [        R                  " X85        [        R                  " X95        g )
N)z
10/02/2014z
11/02/2014z
12/02/2014r  rf   r   r  r   Tr  r  )	r   r   r0   r1   r   r   r   r4   r5   )
r6   r&   r7   r9   idx1idx2idx3idx4idx5idx6s
             r%   test_dayfirst TestToDatetimeMisc.test_dayfirst
  s    8 dAr"HT1b$98D!R;PQ
 S40RXXc]T:3U;288C=4uEU3Z$7VC[48
h-
h-
h-
h-
h-
h-r'   c                    SnSS/n[        SS/SS S9n[        USS	9n[        R                  " X45        [        R                  " [
        US
9   [        USS	9nS S S 5        [        R                  " UW5        g ! , (       d  f       N&= f)NzzParsing dates in .* format when dayfirst=.* was specified. Pass `dayfirst=.*` or specify a format to silence this warning.
31/12/2014z
10/03/2011z
2014-12-31z
2011-03-10r  r+  Tro  rh   F)r   r   r4   r5   r
  r}  )r6   warning_msgr7   r9   res1res2s         r%   "test_dayfirst_warnings_valid_input5TestToDatetimeMisc.test_dayfirst_warnings_valid_input
  s    N 	 \* <(0@t

 3.
h- '';GsU3D H
h- HGs   A88
Bc                     SS/n[         R                  " [        S[         S3S9   [	        USS9  S S S 5        g ! , (       d  f       g = f)Nry  z
03/30/2011zI^time data "03/30/2011" doesn\'t match format "%d/%m/%Y", at position 1. r  rh   Tro  )rk   rl   rm   r  r   )r6   r7   s     r%   $test_dayfirst_warnings_invalid_input7TestToDatetimeMisc.test_dayfirst_warnings_invalid_input  sL     \*]]//>.?qB
 d+
 
 
s	   :
Aklassc                     [        SSS9R                  S5      nUR                  S5      nU" U5      nU" U5      n[        USS9n[        R
                  " XS5        g )Nz
2015-04-05r   r  r!  r   Tr  )r   r  r  r   r4   rI   )r6   r  r  r9   objr8   s         r%   test_to_datetime_dta_tz*TestToDatetimeMisc.test_to_datetime_dta_tz  sS     q188???5)Cj?Sd+
)r'   r&  N)4r'  r(  r)  r*  r  rk   r+  r,  r  r  r  r  r  r  r  r  r  r-  r  r  r  r0  r1  r  r  r  r  r  r"  r%  r*  r   r   r.  r3  r8  r=  rC  r<  rN  rV  rZ  rd  rl  rv  r}  r  r   r   _from_sequencer  r4  r&  r'   r%   r  r  E	  s    [["$9:&	
  
 [[		
 [[WtUm4
; 5
; [[	
	.	." [[	
"" [[		
	.	. [[	
 "! " [[	
 "! " [[	
""
 [[QR	F S	F#3 1 1" [[X'DE
1 F 
1
"""1 [[X	&(9;v;N'OP" Q"	?/
	+C><&@  %D [[)J	J".&.,," [[W}m6R6R&ST	* U	*r'   r  c                       \ rS rSr\R
                  R                  S/ SQ\R                  \R                  S/SS/SS/SS/SS/S	S//5      S
 5       r	\
R                  S 5       rSrg)TestGuessDatetimeFormati+  	test_list)2011-12-30 00:00:00.000000r  r  r  r   r   random_stringr  r  c                 r    Sn[         R                  " U[        S9n[        R                  " U5      U:X  d   eg )Nr   r-   )r0   r1   r2   tools _guess_datetime_format_for_array)r6   r  expected_format
test_arrays       r%   $test_guess_datetime_format_for_array<TestGuessDatetimeFormat.test_guess_datetime_format_for_array,  s2    " 1XXiv6
55jA_TTTr'   c                     [         R                  " [        R                  " [        R                  [        R                  [        R                  /SS95      nUb   eg )Nr2  r-   )r  r  r0   r1   rj   )r6   format_for_string_of_nanss     r%   -test_guess_datetime_format_for_array_all_nansETestGuessDatetimeFormat.test_guess_datetime_format_for_array_all_nansA  sB    $)$J$JHHbffbffbff-S9%
! )000r'   r&  N)r'  r(  r)  r*  rk   r+  r,  r0   rj   r  r0  r1  r  r4  r&  r'   r%   r  r  +  s    [[
 VVRVV9:-.01)?;0123	
 U! U
 1 1r'   r  c                   R   \ rS rSr\R
                  R                  S/ SQ5      S 5       rS rS r	S r
S r\R
                  R                  S	/ S
Q5      S 5       r\R
                  R                  S/ SQ5      S 5       r\R
                  R                  SSS/5      S 5       rS rSrg)TestToDatetimeInferFormatiI  test_format)z%m-%d-%Yz%m/%d/%Y %H:%M:%S.%fr  c                    ^ [        [        SSSS95      nUR                  U4S j5      n[        UTUS9n[        XAS9n[        R
                  " XV5        g )Nr=   2   rf  r  r  c                 &   > U R                  T5      $ ra  )strftime)r_   r  s    r%   re  dTestToDatetimeInferFormat.test_to_datetime_infer_datetime_format_consistent_format.<locals>.<lambda>R  s    ajj.Er'   rG   r   )r   r   rZ   r   r4   r\   )r6   r&   r  r^   s_as_dt_stringswith_formatwithout_formats     `    r%   8test_to_datetime_infer_datetime_format_consistent_formatRTestToDatetimeInferFormat.test_to_datetime_infer_datetime_format_consistent_formatJ  sO     Z
BSAB))$EF!/+US$_B 	{;r'   c                     / SQn[        [        R                  " U5      5      nS[         S3n[        R
                  " [        US9   [        X1S9  S S S 5        g ! , (       d  f       g = f)N)01/01/2011 00:00:00z01-02-2011 00:00:00z2011-01-03T00:00:00z[^time data "01-02-2011 00:00:00" doesn\'t match format "%m/%d/%Y %H:%M:%S", at position 1. r  rh   r   )r   r0   r1   r  rk   rl   rm   r   )r6   r&   r   r^   r  s        r%   $test_to_datetime_inconsistent_format>TestToDatetimeInferFormat.test_to_datetime_inconsistent_format[  sU    TRXXd^$44C3DAG 	 ]]:S1) 211s   
A
A(c                     / SQn[        [        R                  " U5      5      n[        X1S9n[        / SQSS9n[        R
                  " XE5        g )N)zJan/01/2011zFeb/01/2011zMar/01/2011r   )
2011-01-01z
2011-02-01z
2011-03-01r  r-   )r   r0   r1   r   r4   r\   )r6   r&   r   r^   r8   r9   s         r%   "test_to_datetime_consistent_format<TestToDatetimeInferFormat.test_to_datetime_consistent_formate  sC    <RXXd^$S.6>N
 	v0r'   c                     [        [        R                  " S[        R                  S[        R                  /[        S95      n[        X!S9n[        S[        S[        /SS9n[        R                  " X45        g )Nr  01/03/2011 00:00:00r-   r   r  
2011-01-03r  	r   r0   r1   rj   r2   r   r   r4   r\   r|   s        r%   !test_to_datetime_series_with_nans;TestToDatetimeInferFormat.test_to_datetime_series_with_nansn  se    HH&0ErvvN
 S.3c2:J
 	v0r'   c           	          [        [        R                  " [        R                  [        R                  SSS/[        S95      n[        X!S9n[        [        [        SSS/S	S9n[        R                  " X45        g )
Nr  z01/02/2011 00:00:00r  r-   r   r  z
2011-01-02r  r  r  r|   s        r%   'test_to_datetime_series_start_with_nansATestToDatetimeInferFormat.test_to_datetime_series_start_with_nans{  sp    HHFFFF))) 	
 S.#|\<@HX
 	v0r'   ztz_name, offset))r   r   )zUTC-3   )zUTC+3iLc                     [        SU 3/5      n[        U5      n[        [        US95      n[        [	        S5      R                  U5      /5      n[        R                  " XF5        g )Nz2019-02-02 08:07:13 r   2019-02-02 08:07:13)r   r   r   r   r   r  r4   r\   )r6   tz_namer  r^   r8   r   r9   s          r%   "test_infer_datetime_format_tz_name<TestToDatetimeInferFormat.test_infer_datetime_format_tz_name  s^     ,WI678S!i/09%:;GGKLM
v0r'   z
ts,zero_tz))r  Z)r  r   )2019-02-02 08:07:13.012345r  )r  r   c                     [        X-   /5      n[        U5      nUS:X  a  [        R                  OS n[        [	        XS9/5      n[
        R                  " XF5        g )Nr  r   )r   r   r2  r  r   r4   r\   )r6   r  zero_tzr^   r8   r   r9   s          r%   "test_infer_datetime_format_zero_tz<TestToDatetimeInferFormat.test_infer_datetime_format_zero_tz  sM     bl^$S! CTXXT9R/01
v0r'   rH   Nr   c                     [        / SQ5      n[        [        S5      [        S5      [        S5      /5      n[        X2US9n[        R                  " XT5        g )N)2014-1-1z2014-2-2z2015-3-3z
2014-01-01z
2014-02-02z
2015-03-03rG   rK  )r6   r&   rH   r^   r9   r8   s         r%   %test_to_datetime_iso8601_noleading_0s?TestToDatetimeInferFormat.test_to_datetime_iso8601_noleading_0s  sR     9:,',','
 Su=
v0r'   c                     [         R                  " [        SS9   [        S/SS9  S S S 5        g ! , (       d  f       g = f)Nz2The argument 'infer_datetime_format' is deprecatedrh   z
10-10-2000T)infer_datetime_format)r4   r
  r}  r   ru  s    r%   .test_parse_dates_infer_datetime_format_warningHTestToDatetimeInferFormat.test_parse_dates_infer_datetime_format_warning  s4    ''F
 dC	
 
 
   /
=r&  )r'  r(  r)  r*  rk   r+  r,  r  r  r  r  r  r  r  r  r  r4  r&  r'   r%   r  r  I  s    [[S<<*111( [[51	1 [[	
11 [[Xj'9:1 ;1Dr'   r  c                      \ rS rSr\R
                  R                  SSS/SS/SS/SS//5      S 5       rS	 r\R
                  R                  S
SSS\	 S\
 S34SSS\	 S\
 S34SSS\
 S34SSS\
 S34SSS\	 S\
 S34SSS\	 S\
 S34/5      S 5       r\R
                  R                  SSS/SS/SS/SS//5      S 5       rSrg)TestDaysInMonthi  r  
2015-02-29Nr   z
2015-02-32z
2015-04-31c           	      :    [        [        USX1S95      (       d   eg )Nr   r{   rH   r&   )r   r   )r6   r&   rQ   rH   s       r%   test_day_not_in_month_coerce,TestDaysInMonth.test_day_not_in_month_coerce  s     KHVQRRRRr'   c                     [         (       a  SnOSn[        R                  " [        US9   [	        SSUS9  S S S 5        g ! , (       d  f       g = f)NzBday 29 must be in range 1..28 for month 2 in year 2015: 2015-02-29z)day is out of range for month: 2015-02-29rh   r  r  r  )r   rk   rl   rm   r   r]  s      r%   test_day_not_in_month_raise+TestDaysInMonth.test_day_not_in_month_raise  s7    5VC=C]]:S1WEB 211s	   ?
Azarg, format, msg^z. r  z
2015-29-02r   zS^unconverted data remains when parsing with format "%Y-%m-%d": "2", at position 0. z
2015-32-02zH^time data "2015-32-02" doesn't match format "%Y-%d-%m", at position 0. z
2015-31-04c                     [         R                  " [        US9   [        USX1S9  S S S 5        g ! , (       d  f       g = f)Nrh   r  r  r}  )r6   r&   rQ   rH   r  s        r%   !test_day_not_in_month_raise_value1TestDaysInMonth.test_day_not_in_month_raise_value  s+    N ]]:S1GFH 211r  zexpected, formatc                 (    [        USX1S9nXB:X  d   eg )Nry   r  r   )r6   r&   r9   rH   r8   s        r%   test_day_not_in_month_ignore,TestDaysInMonth.test_day_not_in_month_ignore  s     XhvS!!!r'   r&  )r'  r(  r)  r*  rk   r+  r,  r  r  DAY_IS_OUT_OF_RANGEr  r  r  r4  r&  r'   r%   r  r    s    [[4 :&:&:&		
SSC [[ '(?*;1= '(?*;1= ""1!2!5 ""1!2!5 '(?*;1= '(?*;1=9!	
$JIK$JI
 [[4 :&:&:&		
""r'   r  c                      \ rS rSr\R
                  R                  S/ S\" SSS5      4PS\" SSS5      4PS	\" SSS5      4PS
\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS\" SSS5      4PS \" SSS5      4PS!\" SSS5      4PS"\" SSS5      4PS#\" S$S%S5      4PS&\" SSS'5      4PS(\" SSS'SS)5      4PS*\" SSS'S+S,5      4PS-\" SSS'SS)5      4PS.\" SSS'S+S,5      4PS/\" SSS'SS)5      4PS0\" SSS'SS)S15      4PS2\" SSS'SS)S15      4PS3\" SSS'S4S)S15      4PS5\" SSS'S+S,5      4PS6\" S7S'S8SS9S:5      4PS;\" S7S'S85      4PS<\" S7S'S85      4PS=\" S>SS5      4PS?\" S>S@S5      4PSA\" S>S@S5      4PSB\" S>S@S5      4PSC\" S>S@S5      4PSD\" SESSSF5      4PSG\" SESSSFSH5      4PSI\" SESSSFSHSJ5      4P5      SK 5       rSL r	SM r
\R
                  R                  SNSOSPSP\" SQSS5      4SOSRSP\" SQSS5      4SOSPSR\" SSSSF5      4SOSRSR\" SSSFS5      4STSPSP\" SUSFSV5      4STSRSP\" SUSFSV5      4STSPSR\" S$SFSW5      4STSRSR\" S$SFSW5      4/5      SX 5       r\R
                  R                  SYSZ\" SSSSS)5      /S[\" SSSS'S%5      //5      S\ 5       r\R
                  R                  S]S^\" \" S_S`95      Sa4Sb\" \" ScS`95      Sd4/5      Se 5       rSfrgg)hTestDatetimeParsingWrappersi  zdate_str, expectedr  i  r   2Q2005i  r   2Q052005Q105Q12011Q3ro  11Q33Q20113Q112000Q4r   r   00Q44Q20004Q002000q4z2000-Q4z00-Q4z4Q-2000z4Q-0000q42005z2005-11r  z2005 11z11-2005z11 2005200511r?  rW   20051109	   z20051109 10:15r  z20051109 08H   r   z2005-11-09 10:15z2005-11-09 08Hz2005/11/09 10:15z2005/11/09 10:15:32    z2005/11/09 10:15:32 AMz2005/11/09 10:15:32 PM   z2005/11/09 08HzThu Sep 25 10:36:28 2003i     $      zThu Sep 25 2003zSep 25 2003zJanuary 1 2014r  z2014-06r(  z06-2014z2014-6z6-2014z20010101 12r   r   z20010101 1234r   z20010101 123456r   c                    Sn[         R                  " XS9u  pV[        XS9n[        U/US9n[        [        R                  " U/[
        S9XCS9n	[        U/US9n
[        [        U/5      US9n[        [        U/5      US9nXW4 H
  nX:X  a  M
   e   XXU4 H.  n[        [        U5      /5      n[        R                  " X5        M0     U(       d'  [        U5      nX:X  d   e[        USSUS9nUU:X  d   eg g )NT)	yearfirstr-   )r  r&   Sr   )r  r  r  )r   parse_datetime_string_with_resor   r0   r1   r2   r   r   r   r   r4   r5   r   )r6   r)  r9   r&   r  re  _rM  rN  rO  result6result8result9r;  r   result5result7s                    r%   test_parsers(TestDatetimeParsingWrappers.test_parsers  s   p 	<<

 h<xjI>HHhZv.)
  
i@xj 1YGz 2iH%C?"? &g@C8!4 56C!!#+ A
 )G&&& Q)TGh&&&	 r'   c                 n    [        [        [        /SS9n[        X#/US9n[        R                  " XT5        g )Nr  r-   r   )r   r   r   r4   r5   )r6   r&   unique_nulls_fixtureunique_nulls_fixture2r9   r8   s         r%   test_na_values_with_cache5TestDatetimeParsingWrappers.test_na_values_with_cacheh  s4     #s+;<2JRWX
f/r'   c                     [         R                  " S5      u  p[        S5      n[        S5      n[	        S/5      S   nU[
        L d   eU[
        L d   eU[
        L d   eU[
        L d   eg )Nr   r   )r   r  r   r   r   r   )r6   re  r  rM  rN  rO  s         r%   test_parsers_nat,TestDatetimeParsingWrappers.test_parsers_natp  si    <<UC
e$E"(+#~~#~~#~~#~~r'   z'date_str, dayfirst, yearfirst, expectedz10-11-12Fr   Ti  z20/12/21i  r     c                     [        X#US9nXe:X  d   e[        R                  " X#US9u  pxU(       d  U(       d  [        U5      n	X:X  d   e[	        X#XAS9n
[        U/X4S9S   nXu:X  d   eX:X  d   eX:X  d   eg )N)r  r  )r  r  r&   r   )r	   r   r  r   r   r   )r6   r&   r)  r  r  r9   dateutil_resultre  r  rM  rN  rO  s               r%   test_parsers_dayfirst_yearfirst;TestDatetimeParsingWrappers.test_parsers_dayfirst_yearfirst{  s    v  yQ***<<9


 	)G&&&9
  
XSTUV"""""""""r'   zdate_str, exp_defz10:15z9:05c                     [        U5      n[        R                  " U5      u  pE[        U5      n[        U/5      n[	        U5      n[        U/5      S   n	XB:X  d   eXc:X  d   eXs:X  d   eX:X  d   eX:X  d   eg )Nr   )r	   r   r  r   r   r   )
r6   r)  exp_defexp_nowre  r  rM  rN  rO  r   s
             r%   test_parsers_timestring3TestDatetimeParsingWrappers.test_parsers_timestring  s     /<<XF
h'xj)H%
+A. !!!!!!!!!!!!!!!r'   zdt_string, tz, dt_string_reprz2013-01-01 05:45+0545iY  r   z5Timestamp('2013-01-01 05:45:00+0545', tz='UTC+05:45')z2013-01-01 05:30+0530iJ  z5Timestamp('2013-01-01 05:30:00+0530', tz='UTC+05:30')c                     [        SUS9nUR                  S5      R                  U5      n[        X!S9nXV:X  d   eU[        U5      :X  d   eg )Nz2013-01-01 00:00:00r   r   )r   r  rC  repr)r6   r&   	dt_stringr   dt_string_reprrj  dt_times          r%   .test_parsers_timezone_minute_offsets_roundtripJTestDatetimeParsingWrappers.test_parsers_timezone_minute_offsets_roundtrip  sR    & 0>&11"5i5g...r'   r&  N)r'  r(  r)  r*  rk   r+  r,  r   r  r  r
  r  r  r   r   r  r4  r&  r'   r%   r  r    sh   [[1	
8D!Q/01	
xa+,1	
 XdAq)*1	
 xa+,	1	

 XdAq)*1	
 xa+,1	
 XdAq)*1	
 xa+,1	
 XdAq)*1	
 xb!,-1	
 XdB*+1	
 xb!,-1	
 XdB*+1	
 xb!,-1	
  r1-.!1	
" htR+,#1	
$ r1-.%1	
& htR+,'1	
( XdB*+)1	
* XdAq)*+1	
, r1-.-1	
. r1-./1	
0 r1-.11	
2 r1-.31	
4 xa,-51	
6 $A./71	
8 xb!R<=91	
: XdB1a89;1	
<  $Ar2!>?=1	
> xb!Q:;?1	
@  $Ar2!>?A1	
B #HT2q"b"$EFC1	
D &xb!RR'HIE1	
F &xb!RR'HIG1	
H xb!Q:;I1	
J ($2r2r)JKK1	
L q" 56M1	
N HT1b12O1	
P xa34Q1	
T q!,-U1	
V q!,-W1	
X xa+,Y1	
Z xa+,[1	
\ HT1a45]1	
^ htQ2r:;_1	
` q!RR @Aa1	
4j'k4j'@0	 [[1xb"'=>uhtR&<=htR&<=tXdB%;<xb"'=>uhtR&<=htR&<=tXdB%;<		
B#B#H [[
8Aq!R,	-Aq!Q8O/PQ"	"$ [[' (3/0G (3/0G	
//r'   r  )r  r  rN  rt  r  c                     U R                   $ )z1Day and some time units.

* D
* s
* ms
* us
* ns
r!   r#   s    r%   unitsr    s     ==r'   c                      [        S5      $ )zTimestamp at 1960-01-01.
1960-01-01r-  r&  r'   r%   
epoch_1960r!  	  s     \""r'   c                  *    [        [        S5      5      $ )NrW   )r  r  r&  r'   r%   units_from_epochsr#    s    a>r'   )r  
pydatetimer  str_1960c                     UR                   S;   d   eUR                   S:X  a  U $ UR                   S:X  a  U R                  5       $ UR                   S:X  a  U R                  5       $ [        U 5      $ )zdTimestamp at 1960-01-01 in various forms.

* Timestamp
* datetime.datetime
* numpy.datetime64
* str
>   r%  r  r  r$  r  r$  r  )r"   rc  to_datetime64r[   )r!  r$   s     r%   epochsr(    si     ==QQQQ}}#	,	&''))	,	&'')):r'   c                  F    [        SSS9R                  5       R                  $ )Nr  r   r  )r   to_julian_daterK   r&  r'   r%   julian_datesr+  (  s    j"-<<>EEEr'   c                   ~   \ rS rSrS rS rS rS rS r\	R                  R                  SSS	/5      S
 5       r\	R                  R                  S\" SSS5      \" SSS5      S\R                   " S5      /5      S 5       r\	R                  R                  SS\4S\4S\4\" SSS5      \4/5      S 5       rS rS r\	R                  R                  SS\4SS/5      S 5       r\	R                  R                  S/ SQ/ SQ/ SQ/5      S  5       r\	R                  R                  S!/ S"Q/ S#Q/ S$Q/ S%Q/5      S& 5       rS'rg)(
TestOrigini-  c                 x    [        SSSS9n[        S5      nX:X  d   e[        SSSS9n[        S5      nX:X  d   eg )Nr   r  r  z1970-01-01 00:00:02i ʚ;z2001-09-09 01:46:41rP   )r6   r  r9   s      r%   test_origin_and_unitTestOrigin.test_origin_and_unit.  sH    Q/23~~];23~~r'   c                     [        [        USSS95      n[        [        U[        S5      R                  5       -
  SS95      n[        R
                  " X#5        g )Nr  julianr  r   r  )r   r   r   r*  r4   r\   )r6   r+  r8   r9   s       r%   test_julianTestOrigin.test_julian8  sM     Ls8LMy|'B'B'DD3O
 	v0r'   c                     [        [        / SQSSS95      n[        [        S5      [        S5      [        S5      /SS	9n[        R                  " X5        g )
N)r   r   rf   r  r  r  z
1970-01-01r  rT  r   r-   rE  r   s      r%   	test_unixTestOrigin.test_unixB  sK    ICGH|$i&=y?VW
 	v0r'   c                     [        SSSS9nUR                  5       S:X  d   eSn[        R                  " [        US9   [        SSSS9  S S S 5        g ! , (       d  f       g = f)NiR|% r2  r  r  r  z&1 is Out of Bounds for origin='julian'rh   r   )r   r*  rk   rl   rm   )r6   r8   r  s      r%   test_julian_round_trip!TestOrigin.test_julian_round_tripJ  sT    WXC@$$&'111 7]]:S1(5 211s   A
A c                     US:w  a/  Sn[         R                  " [        US9   [        X!SS9  S S S 5        g g ! , (       d  f       g = f)Nr  z$unit must be 'D' for origin='julian'rh   r2  r  r}  )r6   r  r+  r  s       r%   test_invalid_unitTestOrigin.test_invalid_unitS  s:    C<8Cz5LXF 65 55s	   7
Ar  r  r  c                     Sn[         R                  " [        US9   [        SSUS9  S S S 5        g ! , (       d  f       g = f)Nz(it must be numeric with a unit specifiedrh   z
2005-01-01r   r9  r}  )r6   r  r  s      r%   test_invalid_originTestOrigin.test_invalid_originZ  s/     9]]:S1\E 211rc  r(    r   r   c           
      "   [        SSS5      n[        R                  " S[        R                  S9n[	        U Vs/ s H  n[
        R                  " XQS9U-   PM     sn5      n[	        [        XAUS95      n[        R                  " Xv5        g s  snf )NrB  r   rW   r-   r  r  )
r   r0   rO  r  r   r   	Timedeltar   r4   r\   )r6   r  r(  r!  r#  r_   r9   r8   s           r%   
test_epochTestOrigin.test_epocha  s{     tQ*
IIarxx8?PQ?P!R\\!(:5?PQ
 $5&QR
v0	 Rs   !Bzorigin, excr  rE  z
13-24-1990c                     SR                  SU S3SU S3S/5      n[        R                  " X%S9   [        XCUS9  S S S 5        g ! , (       d  f       g = f)Nr  zorigin z is Out of Boundsz# cannot be converted to a Timestampz,Cannot cast .* to unit='ns' without overflowrh   r  )r  rk   rl   r   )r6   r  excr  r#  r  s         r%   test_invalid_originsTestOrigin.test_invalid_originst  sY     hh&!23&!DE>
 ]]3*)fE +**s   A
Ac                     [         R                  " [        SS9   [        SS[	        SSS[
        R                  S9S9  S S S 5        g ! , (       d  f       g = f)Nzmust be tz-naiverh   r   r  r   r   r  )rk   rl   rm   r   r   r2  r  ru  s    r%   test_invalid_origins_tzinfo&TestOrigin.test_invalid_origins_tzinfo  s9    ]]:-?@HT1a,QR A@@s   $A
Ac                     Sn[         R                  " [        US9   [        SS/5        S S S 5        g ! , (       d  f       g = f)NzIUnknown datetime string format, unable to parse: yesterday, at position 1rh   r  	yesterdayr}  rH  s     r%   test_incorrect_value_exception)TestOrigin.test_incorrect_value_exception  s6     X 	 ]]:S1+./ 211r
  zformat, warningN)r   N)r   Nc                     Sn[         R                  " [        US9   [        SUS9  S S S 5        g ! , (       d  f       g = f)NzG^Out of bounds nanosecond timestamp: 2417-10-10 00:00:00, at position 0rh   z2417-10-10 00:00:00r   r  )r6   rH   r-  r  s       r%   .test_to_datetime_out_of_bounds_with_format_arg9TestOrigin.test_to_datetime_out_of_bounds_with_format_arg  s0     Y]].c:-f= ;::r  zarg, origin, expected_str)( r  z2169-11-13 00:00:00)rU  
1870-01-012069-11-13 00:00:00)鼫 rV  2169-10-20 00:00:00c                     [        USUS9n[        U5      nXE:X  d   e[        SSSS9n[        S5      nXE:X  d   e[        SSSS9n[        S5      nXE:X  d   eg )Nr  r  rU  rV  rW  rX  rY  rP   )r6   rQ   r  expected_strr8   r9   s         r%   test_processing_order TestOrigin.test_processing_order  sr     Ss6:\*!!!YSF23!!!YSF23!!!r'   zoffset,utc,exp)r  T2019-01-01T00:00:00.000Z)r  Nr^  )-01:00Tz2019-01-01T01:00:00.000Z)r_  Nz2019-01-01T00:00:00.000-01:00c                     SU-   n[        U/SUS9n[        U/5      R                  S5      n[        R                  " XV5        g )Nz2019-01-01T00:00:00.000r  )r  r  )r   r  r4   r5   )r6   r  r  r   rQ   r8   r9   s          r%   test_arg_tz_ns_unitTestOrigin.test_arg_tz_ns_unit  sC     (&0cU37u%--d3
f/r'   r&  )r'  r(  r)  r*  r/  r3  r6  r:  r=  rk   r+  r,  r@  r   r   r0   r  rE  rm   r   rI  rL  rP  r}  rS  r\  ra  r4  r&  r'   r%   r-  r-  -  s   116G [[VdC[1F 2F [[dAq!T1a MM,'		
11 [[j)j!:&aA 34		
	F	FS
0 [[;''	
>> [[#6<<	
""  [[338=		
00r'   r-  c            
       R   \ rS rSr\R
                  R                  S/ SQS4/ SQS4/5      S 5       r\R
                  R                  SS	S
/5      S 5       r\R
                  R                  S\	" \
" S5      /S-  5      \
" S5      /S-  \" \
" S5      /S-  5      /5      S 5       rSrg)TestShouldCachei  zlistlike,do_caching)
r   rf   r   r   rW   r(  ro  r  r  r   F)
r   r   r   r   r   rW   r(  ro  r  r  Tc                 N    [         R                  " U[        U5      SS9U:X  d   eg )Ngffffff?)check_countunique_share)r  should_cacher|  )r6   listlike
do_cachings      r%   test_should_cache!TestShouldCache.test_should_cache  s-     xS]QTU	
r'   z%unique_share,check_count, err_message)g      ?r  z5check_count must be in next bounds: \[0; len\(arg\)\])r   rf   z-unique_share must be in next bounds: \(0; 1\)c                     S/S-  n[         R                  " [        US9   [        R                  " XAU5        S S S 5        g ! , (       d  f       g = f)NrW   r   rh   )rk   rl   AssertionErrorr  rh  )r6   rg  rf  err_messagerQ   s        r%   test_should_cache_errors(TestShouldCache.test_should_cache_errors  s9     cBh]]>=s+> >==s   A
Ari  r  r  c                 :    [         R                  " U5      SL d   eg )NT)r  rh  )r6   ri  s     r%   &test_no_slicing_errors_in_should_cache6TestShouldCache.test_no_slicing_errors_in_should_cache  s     !!(+t333r'   r&  N)r'  r(  r)  r*  rk   r+  r,  rk  rp  r   r   r  rs  r4  r&  r'   r%   rd  rd    s    [[+U3+T2	


 [[/OE	
?? [[I345:;-./"4I345:;	
44r'   rd  c            	         [        / SQ5      n U R                  S5      n U R                  5       n[        U SS9n[        [        R
                  " S5      [        R
                  " S5      [        R
                  " S5      [        R
                  " S5      [        R
                  " S5      /5      n[        R                  " X#5        [        R                  " X5        g )	N)r   rf   Nl            NInt64r  r  z1970-01-01 00:00:00.000000001z1970-01-01 00:00:00.000000002r   z2043-01-25 23:56:49.213693952)r   r  r  r   r0   r  r4   r\   )r^   ser_copyr;  r9   s       r%   !test_nullable_integer_to_datetimerx    s    
*
+C
**W
CxxzH
c
%CMM9:MM9:MM% MM9:MM% 	
H 3)3)r'   r  c                     [        U [        5      (       a5  [        R                  " [        SS9   [        U" U /5      5        S S S 5        g [        U" U /5      5      nUS   [        L d   eg ! , (       d  f       g = f)Nznot convertible to datetimerh   r   )r:  r   rk   rl   rW  r   r   )nulls_fixturer  r8   s      r%   test_na_to_datetimer{  
  se    -))]]9,IJ}o./ KJ UM?34ayC KJs   A,,
A:r{   r  zargs, format)z
03/24/2016z
03/25/2016r   r@   )
2016-03-24
2016-03-25r   r   rS  rR  rT  c                 |    [        U5      n[        X2U S9n[        SS[        /SS9n[        R                  " XT5        g )Nr   r|  r}  r  r-   )r   r   r   r4   r\   )r{   ri  rH   r0  r8   r9   s         r%   test_empty_string_datetimer    s=     
B 6:F|\37?OPH8,r'   c                      [        SS/SSS9n [        SS/SS	9n[        R                  " X5        [        SS/SS
S9n [        R                  " X5        g )Nr   r   r  r   r  r<  r   r  r-   r  r  r8   r9   s     r%   'test_empty_string_datetime_coerce__unitr  )  sY     !Rs8<F3U;CSTH(+ !Rs7;F(+r'   r&   c                 f   [         n[        [        S5      USS9nUR                  SSS9R	                  USS9nUR
                  R                  5       R                  [        5      S	-  Ul        [        UR                  S S 2S
4   U S9nUR                  S S 2S
4   n[        R                  " X45        g )N1980YSr  FDTr_  r   )nrandom_statei  r   r   )r   r   r   to_framesampler  	to_seriesr  rc   r   r  r4   r\   )r&   cstarttimesr8   r9   s        r%   +test_to_datetime_monotonic_increasing_indexr  5  s     Fy(&tDENNTN299FQR9SE++'')007$>EKAqD)7Fzz!Q$H6,r'   series_length(   r   rW   c                 6   [        [        R                  " S5      /[        R                  " S5      /U -  -   [        S9n[	        USSS9n[        [
        /[        S5      /U -  -   5      n[        R                  " X#5        [	        USSS9n[        [        R                  " S5      /[        R                  " S5      /U -  -   5      n[        R                  " XE5        [        R                  " [        SS	9   [	        US
SS9  S S S 5        g ! , (       d  f       g = f)Nz1446-04-12 00:00:00+00:00z1991-10-20 00:00:00+00:00r-   r   T)r{   r  ry   r  rh   r  )r   r   fromisoformatr2   r   r   r   r4   r\   rk   rl   r   )r  r^   re  	expected1rM  r  s         r%   2test_to_datetime_cache_coerce_50_lines_outofboundsr  A  s    			 ;	<=""#>?@=P	RC
 #hD9G	)789MIJI 7.#hD9G			 ;	<=""#>?@=P	RI
 7.	*2V	WCT2 
X	W	Ws   5D


Dc                  L    Sn Sn[        XS9n[        SSSSSSS	S
S9nX#:X  d   eg )Nz15/02/2020 02:03:04.123456789z%d/%m/%Y %H:%M:%S.%fr   r?  rf   r  r   r   r   i  )r#  r$  r%  r&  r'  rs  microsecond
nanosecondrP   )r  timestamp_formatr8   r9   s       r%   %test_to_datetime_format_f_parse_nanosr  a  sG    /I-<F	H r'   c                  b    [        SS/SS9n [        SS/5      n[        R                  " X5        g )NrW  z2020-01-01 05:00:00rR  r   r  r  r  s     r%   test_to_datetime_mixed_iso8601r  s  s3    ,(=>yQF35JKLH&+r'   c                  b    [        SS/SS9n [        SS/5      n[        R                  " X5        g )Nz
01/11/2000z12 January 2000rI  r   z
2000-01-11z
2000-01-12r  r  s     r%   test_to_datetime_mixed_otherr  z  s1    ,(9:7KFlL9:H&+r'   r   rH   rI  c                     Sn[         R                  " [        US9   [        S/XS9  S S S 5        g ! , (       d  f       g = f)Nz8Cannot use 'exact' when 'format' is 'mixed' or 'ISO8601'rh   rW  )r   rH   r}  )r   rH   r  s      r%   #test_to_datetime_mixed_or_iso_exactr    s0     EC	z	-\N%? 
.	-	-rc  c                      [         R                  " [        SS9   [        SS/SS9  S S S 5        g ! , (       d  f       g = f)Nz9Time data 01-01-2000 is not ISO8601 format, at position 1rh   rW  
01-01-2000rR  r   r}  r&  r'   r%   4test_to_datetime_mixed_not_necessarily_iso8601_raiser    s5    	U
 	\<0C
 
 
rg  )r{   r9   r   r  ry   rW  r  r[   r-   c                 J    [        SS/SU S9n[        R                  " X!5        g )NrW  r  rR  r   r   )r{   r9   r8   s      r%   5test_to_datetime_mixed_not_necessarily_iso8601_coercer    s&     ,5iPVWF&+r'   c                     Sn Sn[         R                  " [        US9   [        U 5      nS S S 5        W[        U S S 5      :X  d   e[         R                  " [        5         [	        U 5      nS S S 5        U[	        U S S 5      :X  d   e[         R                  " [        5         [	        U /5      nS S S 5        [         R
                  " U[	        U S S /5      5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       NU= f)Nz2014 Jan 9 05:15 FAKEzLun-recognized timezone "FAKE". Dropping unrecognized timezones is deprecatedrh   )r4   r
  r  r   r   r5   )dtstrr  r;  s      r%   #test_ignoring_unknown_tz_deprecatedr    s    #E
XC		#	#M	= 
>)E#2J''''		#	#M	2%  
3+eCRj))))		#	#M	25'" 
3#{E#2J<89 
>	= 
3	2 
3	2s#   C C-"C>
C*-
C;>
Dc                     [         R                  " S5        [        SS/U R                  5        S3S9n[	        U5      n[        SS/SS9n[
        R                  " X#5        g )Nr  r   rf   z	[pyarrow]r-   r  )rk   r  r   lowerr   r4   r\   )any_numeric_ea_dtyper^   r8   r9   s       r%   test_from_numeric_arrow_dtyper    s[    
	"
!Q"6"<"<">!?yI
JCFq!f$45H6,r'   c                      SS/n [        U SS9n[        [        S5      S/SS9n[        R                  " X5        [        U 5      n[        R                  " X25        [        U 5      n[        R                  " XB5        g )N2020-01-01 00:00+00:00r   rI  r   r   rJ  r-   )r   r   r   r4   r5   r   )rL  r8   r9   r4  alt2s        r%   6test_to_datetime_with_empty_str_utc_false_format_mixedr    so    $b)Dg.Fi 895AWH&+ d
C#(D$)r'   c                      Sn [         R                  " [        U S9   [        / SQSS9  S S S 5        g ! , (       d  f       g = f)Nr	  rh   )r  z2020-01-01 00:00+02:00r   rI  r   r  )r  s    r%   Btest_to_datetime_with_empty_str_utc_false_offsets_and_format_mixedr    s0    
GC		#	#M	=DW	
 
>	=	=r  c                     [        SSS9n SnX/nSn[        R                  " [        US9   [	        U5        S S S 5        [        R                  " [        US9   [	        USS9  S S S 5        [        R                  " [        US9   [        U5        S S S 5        g ! , (       d  f       Nh= f! , (       d  f       NM= f! , (       d  f       g = f)	Nz2016-01-02 03:04:05r  r   z2023-10-30 15:06+01zsMixed timezones detected. pass utc=True in to_datetime or tz='UTC' in DatetimeIndex to convert to a common timezonerh   rI  r   )r   rk   rl   rm   r   r   )r  r  r7   r  s       r%   &test_to_datetime_mixed_tzs_mixed_typesr    s     
(\	:B!E+C	;  
z	-C 
.	z	-C( 
.	z	-c 
.	-	 
.	-	-	-	-	-s#   BB*B;
B'*
B8;
C	c                  Z   Sn [        U 5      nX/n[        U5      n[        US S S2   5      S S S2   n[        USS9n[        U5      n[        X/5      n[        R                  " X75        [        R                  " XG5        [        R                  " XW5        [        R                  " Xg5        g )Nz2023-11-01 09:22:03-07:00rJ  rI  r   r  )r  r  r7   r{  r|  res3res4r9   s           r%   )test_to_datetime_mixed_types_matching_tzsr    s    'E	5	B+CsDs4R4y!$B$'Ds7+DDbX&H$)$)$)$)r'   r  z)ignore:Could not infer format:UserWarning	aware_valc                 ,    [        U 5      R                  $ ra  r\  r'  rd  s    r%   re  re        $q'""r'   	naive_valic                 ,    [        U 5      R                  $ ra  r  rd  s    r%   re  re     r  r'   naive_firstc                 
   XS/nUnU(       a  XS/n[        U [        5      =(       a    [        U[        5      n[        U[        [        45      nSn[	        S U 5       5      n[        U[        5      (       d  Sn	U(       aZ  [        U [
        5      (       aE  [        U[
        5      (       a  Sn	[        R                  " [        U	S9   [        U5        S S S 5        O-[        R                  " [        U	S9   [        U5        S S S 5        [        USS9  GOU(       a  UR                  U 5      UR                  U5      :  a]  S	n	[        R                  " [        U	S9   [        U5        S S S 5        [        R                  " [        U	S9   [        USS9  S S S 5        GOEU(       a  UR                  U 5      UR                  U5      :  a\  S
n	[        R                  " [        U	S9   [        U5        S S S 5        [        R                  " [        U	S9   [        USS9  S S S 5        OU(       a  UR                  U5      UR                  U 5      :  a\  Sn	[        R                  " [        U	S9   [        U5        S S S 5        [        R                  " [        U	S9   [        USS9  S S S 5        O7[        R                  " [        US9   [        U5        S S S 5        [        USS9  U(       a~  [        R                  " [        US9   [        USS9  S S S 5        [        R                  " [        US9   Sn	[        R                  " [        U	S9   [        U5        S S S 5        S S S 5        g Sn	U(       a  [        U [
        5      (       aq  [        U[
        5      (       a  Sn	[        R                  " [        U	S9   [        USS9  S S S 5        [        R                  " [        U	S9   [        U5        S S S 5        g [        R                  " [        U	S9   [        USS9  S S S 5        [        R                  " [        U	S9   [        U5        S S S 5        g ! , (       d  f       GNV= f! , (       d  f       GNh= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GNM= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       g = f! , (       d  f       GNn= f! , (       d  f       g = f! , (       d  f       GN7= f! , (       d  f       g = f)Nr   zFIn a future version of pandas, parsing datetimes with mixed time zonesc              3   4   #    U  H  oS :w  d  M
  Uv   M     g7f)r   Nr&  )r  r_   s     r%   r  ?test_to_datetime_mixed_awareness_mixed_types.<locals>.<genexpr>  s     4SG!!Ss   		z(Cannot mix tz-aware with tz-naive valuesz<Tz-aware datetime.datetime cannot be converted to datetime64rh   Tr  z!time data .* doesn't match formatz3time data \"2020-01-01 00:00\" doesn't match formatz1unconverted data remains when parsing with formatrI  r   z!DatetimeIndex has mixed timezones)r:  r[   rj  rc   nextr   rk   rl   rm   r   r  r4   r
  r  rW  r   )
r  r  r  rL  vec	both_strshas_numericr  first_non_nullr  s
             r%   ,test_to_datetime_mixed_awareness_mixed_typesr    s    "%D
CR( 9c*Iz)S/IIYe5KWH4S44N nc**8:i;;)Y//Tz5C  65 z5C  6 	CT"	9-		)0DD1]]:S1 2]]:S1& 21 
syy+cii	.BBD]]:S1 2]]:S1& 21 
syy+cii	.BBA]]:S1 2]]:S1& 21 ''XF G 	CT"''XFG, G''XF5Cy4c" 5 GF
 9:i;;)Y//Tz5C0 6z5c" 65 z5C0 6z5c" 65q 65 65 2111
 2111
 2111 GF GF 54 GF 6555 6555s   Q4Q!Q3R"RR))R;SSS1-T	TT4T& T8U	:U
Q!
Q03
R
R
R&)
R8;
S

S
S.1
T 
T	T
T#&
T58
U	
U
U))l__doc__r   collectionsr   r   r   r   r   decimalr   r.  dateutil.parserr	   dateutil.tz.tzr
   numpyr0   rk   r2  pandas._libsr   pandas._libs.tslibsr   r   pandas.compatr   pandas.errorsr   r   pandas.util._test_decoratorsutil_test_decoratorsr0  pandas.core.dtypes.commonr   pandasr   r   r   r   r   r   r   r   r   r   pandas._testing_testingr4   pandas.core.arraysr   pandas.core.toolsr   r  pandas.core.tools.datetimesr   r  rp  r  r+  r  
pytestmarkr  r&   r)   r6  r  rl  r  r  r  r  r  r  r!  r#  r(  r+  r-  rd  rx  r,  r1   r  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   rc   r  r&  r'   r%   <module>r     s         ! #       * ) < 
 
 
  , 0 8  	F	 
 FH [[''8

 e}% &s0 s0l{) {)|'o@ o@d	G1 G1Tc* c*L1 1<wD wDtL" L"^g/ g/T 34	 5	 # #
   LM N& F F\0 \0~%4 %4P*, 288T"23  4  #@A	):6	):6 
	"  - B-	, 4-0- 1- 	,q04Dq4HJ3	38$,, 4-0Iw#78@ 9 1@D 	="7!=>?	5,5UCD,,: -*
&*" 	!u GH
Ie"  
 
3BZ%rwwy"''288U288_U"  
 u6S# 7 IS#r'   