
    Mh>                       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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-r.  SSK/J0r0  SSK1J2r3  SSK4J5r5  Sr6\Rn                  Rq                  S5      r9\Rt                  " SS/S9S 5       r; " S S5      r< " S S5      r= " S S5      r> " S S5      r? " S S5      r@ " S  S!5      rA " S" S#5      rB " S$ S%5      rC " S& S'5      rD\Rt                  " / S(QS9S) 5       rE\Rt                  S* 5       rF\Rt                  S+ 5       rG\Rt                  " / S,QS9S- 5       rH\Rt                  S. 5       rI " S/ S05      rJ " S1 S25      rKS3 rL\Rn                  R                  S4\R                  \O/5      S5 5       rP\Rn                  R                  S6/ S7Q5      \Rn                  R                  S8/ S9QS:4/ S;QS<4/S=S>/S?9S@ 5       5       rQSA rR\Rn                  R                  SBSS/5      SC 5       rS\Rn                  R                  SDSE\5\5SF-   \5SG-   /5      SH 5       rTSI rUSJ rVSK rW\Rn                  R                  SLSS/5      \Rn                  R                  SMS>SN/5      SO 5       5       rXSP rY\Rn                  R                  SQSR\$" SS\&/5      4ST\%" SUSV/\ZSW94/5      SX 5       r[SY r\SZ r]S[ r^S\ r_S] r`S^ raS_rb\(" \b5      rc\Rn                  Rq                  S`5      \Rn                  R                  Sa\b\(" \b5      /Sb S?9\Rn                  R                  Sc\bSSd \cR                  S5      \cR                  5       \cR                  \cR                  \g" \cR                  5      /Se S?9\Rn                  R                  SfSS/5      Sg 5       5       5       5       rhg)hztest to_datetime     N)deque)datedatetime	timedeltatimezone)Decimal)parse)tzoffset)tslib)iNaTparsing)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.z2ignore:errors='ignore' is deprecated:FutureWarningTF)paramsc                     U R                   $ )z'
cache keyword to pass to to_datetime.
paramrequests    U/var/www/html/env/lib/python3.13/site-packages/pandas/tests/tools/test_to_datetime.pycacher$   A   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)TestTimeConversionFormatsI   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_readonlyJ   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   r2   assert_equal)r4   r$   index_or_seriesrF   r7   valuesr6   s          r#   test_to_datetime_format1TestTimeConversionFormats.test_to_datetime_formatT   s1     !!EFV%@"8,
)r%   zarg, expected, format)rB   r;   r:   )rB   r;   r>   )rC   r<   r:   )rC   r?   r>   )rD   r=   r:   )rD   r@   r>   c                 <    [        X$US9n[        U5      nXS:X  d   eg NrE   r   r   )r4   r$   argr7   rF   r6   s         r#   test_to_datetime_format_scalar8TestTimeConversionFormats.test_to_datetime_format_scalarg   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%drE   r   applystrr   r   r2   assert_series_equalr4   r$   serxr7   r6   s         r#    test_to_datetime_format_YYYYMMDD:TestTimeConversionFormats.test_to_datetime_format_YYYYMMDDw   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)NrS   rT   rU   floatr+   1980122219810105   rV   rE   natzOunconverted data remains when parsing with format "%Y%m%d": ".0", at position 0match)r   r   r.   nanr   r2   rZ   rX   rY   pytestraises
ValueError)r4   r$   r\   r7   r6   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 rU   ra   r+   1980120119810101rd   %Y%mrE   )r   r   r.   rh   r   r2   rZ   )r4   r$   r\   r7   r6   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rV   ignorerF   errorsr$   r+   )r   r   r0   r2   rZ   r4   r$   r\   r6   r7   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20150101rV   rw   rx   r+   )r   r.   rh   r   r0   r2   r3   r4   r$   r6   r7   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 )Nrv   rV   coercerx   )2012123120141231r   M8[ns]r+   r   r   r2   rZ   rz   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)rb   20010112Nrb   r   )rb   r   r   )rS   T1NrS   r   )rS   r   r   c                     [        [        S5      [        S5      [        /5      n[        [        USS95      n[        R
                  " X25        g )Nrb   r   rV   rF   )r   r   r   r   r2   rZ   r4   r   r7   r6   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 )NrV   r   rF   ry   )r   r2   rZ   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   rV   c                 B    [        XS9n[        R                  " XC5        g Nr   r   r2   r3   )r4   datarF   r7   r6   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   r2   r3   r4   r6   r7   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%YrE   )iA i i    -rr   rW   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 )NrV   rw   r   r   )r4   int_dater7   r6   s       r#   .test_int_to_datetime_format_YYYYMMDD_typeerrorHTestTimeConversionFormats.test_int_to_datetime_format_YYYYMMDD_typeerror$  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.%frE   )calendar
month_abbrr   r   strptime)r4   r$   r   valrF   r6   exps          r#   #test_to_datetime_format_microsecond=TestTimeConversionFormats.test_to_datetime_format_microsecond:  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 rM   r   )r4   r$   valuerF   dts        r#   test_to_datetime_format_time6TestTimeConversionFormats.test_to_datetime_format_timeC  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)rF   exactr$   z(\d+\w+\d+))expandrE   )r   r   rY   extractr2   rZ   rz   s        r#   test_to_datetime_with_non_exact9TestTimeConversionFormats.test_to_datetime_with_non_exactr  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rF   r   r   )r4   r$   rF   r7   r6   s        r#   (test_non_exact_doesnt_parse_whole_stringBTestTimeConversionFormats.test_non_exact_doesnt_parse_whole_string  s#    4 .vU
 !!!r%   rO   )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   rE   r   )r4   r$   rO   r7   r6   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 rM   r   )r4   r   fmtr7   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 UTCrd   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   r2   rG   )r4   r   datesexpected_datesr6   r7   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 errorrf   r   )r2   assert_produces_warningFutureWarningr   r   rG   )r4   r   r   r   msgr6   r7   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rF   utcr   r   r2   r3   )r4   r   r   r   r6   r7   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:01 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. rf   r   joinPARSING_ERR_MSGri   rj   rk   r   )r4   r  r   r   r
  s        r#   )test_to_datetime_parse_timezone_malformedCTestTimeConversionFormats.test_to_datetime_parse_timezone_malformed$  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   r2   r3   )r4   r   rO   r6   r7   s        r#   *test_to_datetime_parse_timezone_keeps_nameDTestTimeConversionFormats.test_to_datetime_parse_timezone_keeps_name6  sA    $,-E:S- "7!8UO
f/r%    )5__name__
__module____qualname____firstlineno__ri   markparametrizer8   r   rJ   rP   r^   rm   rs   r{   r   r   r.   rh   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'   I   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)TestToDatetimei?  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 0rf   r   ry   rw   r+   )ri   rj   r   r   r   r2   r3   r   
isinstancerY   r0   )r4   rO   r
  ress       r#   test_to_datetime_overflow(TestToDatetime.test_to_datetime_overflow@  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_convertr2   r3   )r4   d1d2r:  r7   s        r#   *test_to_datetime_mixed_datetime_and_string9TestToDatetime.test_to_datetime_mixed_datetime_and_stringW  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   r2   r3   )r4   valsr]   r7   r6   result2result3result4s           r#   )test_to_datetime_mixed_string_and_numeric8TestToDatetime.test_to_datetime_mixed_string_and_numeric_  s    a  !=1)A,!=>T'2d4R4j9$B$?%TrT
+DbD1
f/
g0
g0
g0 ">s   CrF   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   rd   
2020-01-01r   z
2020-01-02r   r+   )r   r   r   r2   r3   )r4   rF   rC  r:  r7   s        r#   &test_to_datetime_mixed_date_and_string5TestToDatetime.test_to_datetime_mixed_date_and_stringm  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   )	r4   r   r  argsr7   r^  ts1ts2r6   s	            r#   6test_to_datetime_mixed_datetime_and_string_with_formatETestToDatetime.test_to_datetime_mixed_datetime_and_string_with_formatw  s8    p $q'"1gcZ=
f/r%   c                 4    [        U 5      R                  5       $ r`  ra  rc  s    r#   rd  re    rf  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   rf   Fr  )r   r   r2   r  r	  r   r3   )	r4   r   r^  rh  ri  rj  r
  r7   r6   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  rf   z2000-01-01 09:00:00+01:00z2000-01-02 02:00:00+02:00NFr  r2   r  r	  r   r3   )r4   r   r7   r
  r6   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)rv  z2000-02-01 00:00:00+00:00r   znon-ISO8601, UTCc                 J    [        / SQUSS9n[        R                  " X25        g )Nrr  Tr  r   )r4   r   r7   r6   s       r#   (test_to_datetime_mixed_offsets_with_none7TestToDatetime.test_to_datetime_mixed_offsets_with_none  s'    . L

 	f/r%   rh  z2000-01-01 02:00:00-07:00z*all tz-aware, mixed timezones, without utcc                 4    [        U 5      R                  5       $ r`  ra  rc  s    r#   rd  re  (  rf  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=Truerf   Fr  ri   rj   rk   r   )r4   r   rh  r^  ri  rj  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   )
r.   str_r   r   r   ilocr   r2   r3   rZ   )r4   r   r\   r   r:  r7   s         r#   test_to_datetime_np_str&TestToDatetime.test_to_datetime_np_str7  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   )r4   s_formatr   s       r#   %test_to_datetime_iso_week_year_format4TestToDatetime.test_to_datetime_iso_week_year_formatK  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  ry   raiser   rw   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  rf   r   )r-  r.  ri   rj   rk   r   )r4   r
  r  r  ry   s        r#   test_error_iso_week_year'TestToDatetime.test_error_iso_week_yearW  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   )r4   r   dtir5   r6   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   )ri   importorskipr   astyper   
ArrowDtype	timestampr   r   r2   rZ   r3   )	r4   r   r  r  par  	dti_arrowr6   r7   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   r4   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, 1999rw   r8  r   )r4   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)r2   set_timezoner   as_unitr   abs_valuer   )r4   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  )r2   r  r.   
datetime64r  int64r   r   r  r  r  	normalizer  r   )r4   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rO   r  r  c                     [        U/5        g r`  r   )r4   rO   s     r#   (test_to_datetime_today_now_unicode_bytes7TestToDatetime.test_to_datetime_today_now_unicode_bytes:  s    SEr%   zformat, expected_ds))r   
2020-01-03)rY  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  rZ  r+   r   )r   r   getattrr   maxtotal_seconds)r4   rF   expected_dsstring	attributer6   r7   s          r#    test_to_datetime_now_with_format/TestToDatetime.test_to_datetime_now_with_format>  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   rN   )r4   r$   r   s      r#   test_to_datetime_dt64s%TestToDatetime.test_to_datetime_dt64sU  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 )NrV  r   r  )r   r.   r  r   r2   r3   )r4   rO   rF   r6   r7   s        r#   test_to_datetime_dt64s_and_str-TestToDatetime.test_to_datetime_dt64s_and_str[  s;     c2==#>?O ,!=>
f/r%   z
1000-01-01z
5000-01-02)r  rw   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ry   r$   r  )r   r9  r   r  asm8)r4   r$   r   ry   tss        r#   'test_to_datetime_dt64s_out_of_ns_bounds6TestToDatetime.test_to_datetime_dt64s_out_of_ns_boundsh  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-27rf   r  r  r   )r.   r  iinfor  r  ri   rj   r   r   r   r   )r4   r$   dt64r
  s       r#   $test_to_datetime_dt64d_out_of_bounds3TestToDatetime.test_to_datetime_dt64d_out_of_boundsw  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  r8  r   r  r   r   rw   )r.   r  r   r   r   r  r2   r3   r   r/   r   )r4   r$   r  dtsr6   r]   r7   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  rw   r8  )r   r.   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                  /[        S9SS9nS S S 5        [	        S[
        R                  /[        S9n[         R                  " WU5        g ! , (       d  f       ND= f)Nerrors='ignore' is deprecatedrf   z
2362-01-01r+   rw   r8  )	r2   r  r	  r   r   r.   rh   r0   rZ   )r4   r
  r:  r   s       r#   !test_out_of_bounds_errors_ignore20TestToDatetime.test_out_of_bounds_errors_ignore2  sm    -''SAbff-V<XC B lBFF+6:
sC( BAs   'B
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   r2   r3   )r4   r$   r5   r6   r7   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=Truerf   r   r  rw   )r$   ry   z2013-01-01 13:00:00-08:00z2013-01-02 14:00:00-05:00r0   r+   r   r   zdatetime64[ns, US/Pacific])r   ri   rj   rk   r   r2   r  r	  r   r3   r   )r4   r$   r5   r
  depr_msgr6   r7   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+0500rU   r  rf   r   )r   r	   r2   r  r	  r   r3   )	r4   r$   ts_string_1ts_string_2r5   r]   r7   r
  r6   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$   rv  2000-06-01 07:00:00+00:00rZ  r,   r  )r1  r   r.   r/   localizer   r0   r   r   r2   r3   )r4   r$   
us_easternr5   r6   r7   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rF   r  r$   )r   r   r2   rG   )r4   r$   init_constructorend_constructorr   expected_datar6   r7   s           r#   test_to_datetime_utc_true(TestToDatetime.test_to_datetime_utc_true  s^     "#45+6+6

 T"?E
 #=1
)r%   zscalar, expectedr0  r2  r1  r3  c                 *    [        USSUS9nXC:X  d   eg )Nr4  Tr5  r   )r4   r$   scalarr7   r6   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   r2   rZ   )r4   r$   r  r6   r7   s        r#   2test_to_datetime_utc_true_with_series_single_valueATestToDatetime.test_to_datetime_utc_true_with_series_single_value1  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   r2   rZ   )r4   r$   r  expected_tsr   r6   r7   s          r#   4test_to_datetime_utc_true_with_series_tzaware_stringCTestToDatetime.test_to_datetime_utc_true_with_series_tzaware_string8  sQ    (+rdQhTt599[U;<q@A
v0r%   zdate, dtype)rC  r  )rC  rZ  c                 ~    [        [        SSS9/SS9n[        [        U/US9SUS9n[        R                  " XT5        g )NrC  r   r   M8[ns, UTC]r+   Tr(  r   r   r   r2   rZ   )r4   r$   r   r,   r7   r6   s         r#   1test_to_datetime_utc_true_with_series_datetime_ns@TestToDatetime.test_to_datetime_utc_true_with_series_datetime_ns@  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)ry   r  r$   rv  r)  rZ  r*  z2000-01-01 08:00:00r   r  z2000-01-01 13:00:00)ri   r  FixedOffsetTimezoner.   r/   r   r0   r   r   r2   r3   r   )
r4   r"   r$   psycopg2_tztz1tz2r5   r6   r7   is
             r#   test_to_datetime_tz_psycopg2+TestToDatetime.test_to_datetime_tz_psycopg2N  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\]rf   r   r  rw   )ri   rj   	TypeErrorr   r   )r4   r$   rO   r
  s       r#   test_datetime_bool!TestToDatetime.test_datetime_boolt  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 datetimerf   Fr   zA^time data "True" doesn\'t match format "%Y%m%d", at position 1. r  20130101Tr   g        r   r  )typeri   rj   rV  r   r   r  rk   r  r2   r3   r   r   r4   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 datetimerf   )ri   rj   rV  r   )r4   rO   r
  s      r#   test_datetime_invalid_datatype-TestToDatetime.test_datetime_invalid_datatype  s+     /]]9C0 100   1
?)r   r  rw   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%rf   z00:00:00zH%:M%:S%r   r|  )r4   ry   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	/5      n[        R
                  " [        US
9   [        USUS9  S S S 5        g ! , (       d  f       g = f)Nrw   ry   rF   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. 2^second must be in 0..59: 00:01:99, at position 0$rf   r  )r   r   r  r  ri   rj   rk   r4   r   rF   r:  r
  s        r#   test_datetime_invalid_scalar+TestToDatetime.test_datetime_invalid_scalar  s     %@||%@czzhhS"#1&O""1!2!5E	
 ]]:S1gf= 211s   'A<<
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)Nrw   ri  r   z:^time data ".*" doesn\'t match format ".*", at position 0.rf   r  z!^Out of bounds .*, at position 0$)r   r   ri   rj   rk   r   rn  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+rI   )rg  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[        U[        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/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       N= f! , (       d  f       N= f! , (       d  f       N9= f! , (       d  f       g = f)Nr   Could not infer formatFrg   raise_on_extra_warningsrw   ri  r+   r   r  rk  rj  r  rl  rm  rf   r  )lenUserWarningr2   r  r   r3   r   r0   r   r   r  r  ri   rj   rk   )r4   rI   rF   warnr:  r
  s         r#   test_datetime_invalid_index*TestToDatetime.test_datetime_invalid_index  sT    >c&kAoDD''0%
 fXfEC
 	c5v#>?''0%
 fXfEC
 	c=#V1D#EFhhOS"#1&""1!2!5E	
 ]]:S1++4e F76B 21-
 

 
"  21s;   D6?EE)E%E)6
E
E
E&	"E))
E7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  rF   r$   Fr   )	r4   r  rF   r^  r   
test_datesr   r6   r7   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   r2   r3   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   )r4   r  rF   r   r  r   r6   r7   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   rN   )r4   r   r6   r7   s       r#   test_to_datetime_cache_scalar,TestToDatetime.test_to_datetime_cache_scalar  s*    "T.01!!!r%   zdatetimelikes,expected_valuesrd   z
2012-07-26r`  z2012 July 26c                 l    [        USS9n[        USS9n[        USS9n[        R                  " XE5        g )Nr0   r+   r   r8  r  r   )r4   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   r0   r   r  c                 x    [        [        /[        U5      -  SS9n[        X!S9n[        R
                  " XC5        g )Nr   r+   r   )r   r   ry  r   r2   rZ   )r4   r$   r  r7   r6   s        r#   *test_to_datetime_converts_null_like_to_nat9TestToDatetime.test_to_datetime_converts_null_like_to_nat7  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 yearrf   r   r|  )r4   r   rF   r
  s       r#   'test_week_without_day_and_calendar_year6TestToDatetime.test_week_without_day_and_calendar_yearM  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  rf   r   r8    r   r   r   r   i@8  r   iPF  )	r2   r  r	  r   r   r   r
   r   r3   r4   
ts_stringsr
  r6   r7   s        r#   test_to_datetime_coerce&TestToDatetime.test_to_datetime_coerce_  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   ri  r  r   r   )r   r   r   r   r2   r3   )r4   
string_argrF   r  r  r6   r7   s          r#   test_to_datetime_coerce_oob*TestToDatetime.test_to_datetime_coerce_oobr  s@      !.
ZH (4A"6!<=
f/r%   zerrors, expectedr   rw   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  rv  Frw  r8  )r2   r  rz  r   r3   )r4   ry   r7   r  r6   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 0rf   rv  r  r8  ri   rj   rk   r2   r  rz  r   )r4   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:30rd   )r   r   r   r2   r3   )r4   ts_strr6   r7   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  rf   r     rA  r  r   iXM  r      ih[  r+   )r   r2   r  r	  r   r.   r/   r   r
   r0   r   r3   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  rA  r   r   r   )r   r   r   r   r2   r3   )r4   r  r6   r7   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)Nrh   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r`  r%  ).0rR  r\   rK  s     r#   	<genexpr>PTestToDatetime.test_mixed_offsets_with_native_datetime_raises.<locals>.<genexpr>  s      ?.>3q6T!W$.>s   r  rf   r   r+   rI  g?zTz-aware datetime.datetime)r   r   allrangery  r2   r  r	  r   rb  r0   rZ   r  r  ri   rj   rk   )r4   r  r  r
  rH  r7   r\   rK  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  rd   r  r   r   r      r   r   )r   r   r   r   r   r2   r3   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   )r4   r  r7   r6   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 timestamprf   rV   r   ri   rj   r   r   )r4   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  )r.   r/   r	   r0   r   r   r   r  )r4   r5   r6   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   )r2  i\z-07:00r   r   r   rd   r   )-pandas.tests.indexes.datetimes.test_timezonesr2  r   r   r   )r4   r2  	fixed_offr   r6   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>  rA  zAustralia/Melbourner   c                     Sn[         R                  " [        US9   [        USS9  S S S 5        g ! , (       d  f       g = f)Nr  rf   Fr  r2   r  r	  r   )r4   r   r
  s      r#   8test_to_datetime_mixed_offsets_with_utc_false_deprecatedGTestToDatetime.test_to_datetime_mixed_offsets_with_utc_false_deprecated+  s1     L''SA%( BAAr  r%  )er&  r'  r(  r)  ri   r*  filterwarningsr;  rE  rO  r+  rW  r    r   r   rk  ro  r   r   rt  rx  r}  r  r   r  r  r  r/  skip_if_windowsr   r  r  r  r  r  r  r  r  r.   r  r  r  r  
skip_ubsanr  r  r
  r  r  r  r  r-  listr/   r9  r=  r@  rF  rK  rS  rW  r]  boolr   r`  rd  ro  rr  r|  tupler   r  r  r  r  rh   r   r  r   r   r  r  r  r   r  r0   r  r  r  r  r  r  r  r  r  r  r  r1  r   r  r3  r%  r%   r#   r5  r5  ?  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H [[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%   r5  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TestToDatetimeUniti=  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   r2   r3   r.   r/   r0   rh   r   )r4   r$   r  r  r"   r  r7   r6   s           r#   'test_to_datetime_month_or_year_unit_int:TestToDatetimeUnit.test_to_datetime_month_or_year_unit_int>  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 ambiguousrf         ?r  r  ry   z1.5rw   r   r   r+         ?r  r   )ri   rj   rk   r   r.   r/   r2   r  r	  r   r   r3   )r4   r$   r  warn_msgr
  r:  r7   s          r#   3test_to_datetime_month_or_year_unit_non_round_floatFTestToDatetimeUnit.test_to_datetime_month_or_year_unit_non_round_floatS  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 unitrf   r   r  rV   )r  rF   r$   r|  r\  s      r#   	test_unitTestToDatetimeUnit.test_unitt  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 ers  )r4   r$   r:  r7   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  rw   r  ry   r$   
1970-01-02r+   r   )r   r  r  r   r   r   r   r   r   z8cannot convert input 11111111111111111 with the unit 'D'rf   r  )r   r   r.   rh   r   r   r   r0   r2   r3   r   ri   rj   r   r4   r$   rI   r6   r7   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   rw   r  ry   r  r$   r+   r   )r   r   r   r   r   r   z@cannot convert input 1420043460000000000000000 with the unit 's'rf   r  )r   r   r.   rh   r   r   r0   r2   r3   r   ri   rj   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'rf   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   r9  )r4   r$   r  r7   r6   s        r#   test_unit_consistency(TestToDatetimeUnit.test_unit_consistency  s<     23XCK!!!&),,,,r%   ry   )rw   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   r.   r/   r  r   r2   r3   )r4   r$   ry   r,   r7   r5   r6   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+   rv  rf   r   r  )r   r2   r  r   r3   )r4   r$   r   r5   warningr7   r6   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r5   rZ  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   r2   r3   r   )r4   r$   r5   r]   r7   r6   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  rN   )r4   r$   r   r6   r7   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   Brd   r"  r!  rw   r  r  )r   r   r2   r3   r4   r$   r7   r6   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  Trw   )r  r  ry   1970-01-01 00:00:01rI  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   r2   rZ   )r4   r,   epochtr\   r6   r7   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   r2   rZ   )r4   rF  rB  rC  r\   r6   r7   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 )Nr>  r   rd   g      ?r  r  r?  r@  r   r+   ms)r   r.   aranger   r  ra   r   r   r   r   roundr2   rZ   )r4   rB  rC  r\   r6   r7   s         r#   (test_to_datetime_unit_fractional_seconds;TestToDatetimeUnit.test_to_datetime_unit_fractional_seconds*  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   rd   r   r  r  r  
1970-01-03r   r   r+   )r   r   r.   rh   r   r   r2   r3   r   s      r#   test_to_datetime_unit_na_values2TestToDatetimeUnit.test_to_datetime_unit_na_values;  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'rf   r   rd   r  r  r|  )r4   rT  r
  s      r#   test_to_datetime_unit_invalid0TestToDatetimeUnit.test_to_datetime_unit_invalidC  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  rQ  r   r   r   r+   rd   r  r   r  rJ  )r4   rT  r7   r6   s       r#   test_to_timestamp_unit_coerce0TestToDatetimeUnit.test_to_timestamp_unit_coerceI  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|=)rtolrf   r  )r   ra   r  r.   r  r   r2   assert_almost_equalr!  ri   rj   r   )
r4   r
  oneday_in_nstsmax_in_daysshould_succeedr7   
error_moderesult1should_fail1should_fail2s
             r#   (test_float_to_datetime_raise_near_bounds;TestToDatetimeUnit.test_float_to_datetime_raise_near_boundsS  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)  ri   r*  r+  ra   r  r  r  r  r  r  r  r  r'  rz  r+  r   r.  r2  r6  r:  intrD  r   r.   rh   rH  rN  rR  rV  rY  re  r3  r%  r%   r#   r  r  =  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")#TestToDatetimeDataFrameio  c                 P    [        SS/SS/SS/SS/S	S
/SS/SS/SS/SS/S.	5      $ )Nr    rd   r   r   rU   r'     :   ;   r   r  r   	r"  r#  r$  r%  r&  secondrK  usr  )r   r4   s    r#   dfTestToDatetimeDataFrame.dfp  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   r2   rZ   to_dictr4   rs  r$   r6   r7   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 )Nrv  rd   r#  r   rw  z20160205 00:0:00)rx  r   r   r   r2   rZ   )r4   rs  r$   df2r6   	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daysr@  r   rA  )r"  r#  r$  r%  r&  rp  r"  r#  r$  r%  r&  rp  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   r2   rZ   )r4   rs  r$   r  r6   r7   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&  rp  rK  rq  r  ro  r  r   20150204 06:58:10.00100200320160305 07:59:11.001002003)r   r  r   r   r2   rZ   )r4   rs  r$   dr6   r7   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  rY   r   r   r2   rZ   ry  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  rk  rd   r  r   rU   rv  z^^cannot assemble the datetimes: time data ".+" doesn\'t match format "%Y%m%d", at position 1\.rf   r   r   r  rw  )
r   ri   rj   rk   r   r   r   r   r2   rZ   )r4   r$   r}  r
  r6   r7   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\]rf   r   r   r   )ri   rj   rk   copyr   )r4   rs  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#  rp  )r"  r$  rp  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 missingrf   r   r|  )r4   rs  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  rk  rd   r  r   rU   rv  )r"  r"  r$  rf   r   )r"  r#  r$  r%  )r"  r#  r$  r$  )r   r  ri   rj   rk   r   )r4   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  rk  rd   r   r   rU   rv  int16r   rw  20160305 00:00:00)r   r   r  r   r   r2   rZ   r4   r$   rs  r6   r7   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  rk  rd   r   r   rU   rv  r#  int8r$  r   rw  r  )r   r  r   r   r   r2   rZ   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   rv  zk^cannot assemble the datetimes: unconverted data remains when parsing with format ".*": "1", at position 0.rf   r   )r   ri   rj   rk   r   )r4   r$   rs  r
  s       r#   test_dataframe_float,TestToDatetimeDataFrame.test_dataframe_float%	  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  rk  rd   r   r   rU   rv  Tr  z
2015-02-04z
2016-03-05r  r+   r   )	r   r   r   r.   r/   r   tz_localizer2   rZ   )r4   rs  r6   r7   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)  ri   fixturers  rz  r  r*  r+  r  r  r  r  r  r  r  r  r  r  r  r3  r%  r%   r#   ri  ri  o  s    ^^
 
12 [[  !##  ""	
*1+*11,	11* [[HW'e%	
	/	/*	1	1)1r%   ri  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?)@TestToDatetimeMisci9	  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 0rf   )r.   r/   r0   ri   rj   r   r   )r4   r5   r
  s      r#   %test_to_datetime_barely_out_of_bounds8TestToDatetimeMisc.test_to_datetime_barely_out_of_bounds:	  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   rN   )r4   r$   rO   exp_strr6   r   s         r#   test_to_datetime_iso8601+TestToDatetimeMisc.test_to_datetime_iso8601D	  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 0rf   r   r|  )r4   r  rF   r   s       r#   test_to_datetime_iso8601_fails1TestToDatetimeMisc.test_to_datetime_iso8601_failsP	  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. rf   r   r  )r4   r  rF   r
  s       r#   $test_to_datetime_iso8601_exact_fails7TestToDatetimeMisc.test_to_datetime_iso8601_exact_failsj	  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   r4   r  rF   r7   r6   s        r#   "test_to_datetime_iso8601_non_exact5TestToDatetimeMisc.test_to_datetime_iso8601_non_exact	  s*     T1a(U?!!!r%   ))2020-01z%Y/%m)rV  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  rf   r   r|  )r4   r  rF   s      r#   "test_to_datetime_iso8601_separator5TestToDatetimeMisc.test_to_datetime_iso8601_separator	  sF     ]]w 'X.0
 -
 
 
s	   
4
A))r  r  )rV  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   r1  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  )r4   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 specifiedrf   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 )NrB   r   r  r   r   )r   r   r   )r4   r$   r\   r6   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  rf   r  r  r   i  r   rA  r  rw   )
r   r  ri   rj   rk   r   r   r   r2   rZ   )r4   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   rd   r   index%b %yrE   r   r   rX   r2   rZ   )r4   r$   r/  r7   r6   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%   ry   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
  rx   c                    > [        U SSTS9$ )Nr
  r   rx   r   )r]   r$   s    r#   rd  OTestToDatetimeMisc.test_to_datetime_with_apply_with_empty_str.<locals>.<lambda>'
  s    k!GHERr%   r  )r4   r$   ry   r/  r7   r6   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   r4   r$   r6   s      r#   test_to_datetime_empty_stt-TestToDatetimeMisc.test_to_datetime_empty_stt+
  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_list0
  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_zero4
  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   r5  s       r#   test_to_datetime_strings+TestToDatetimeMisc.test_to_datetime_strings:
  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   r2   r]  )r4   r$   r/   r  r7   date_strr6   s          r#   "test_to_datetime_strings_variation5TestToDatetimeMisc.test_to_datetime_strings_variation@
  sP    9CHI5K45I6;<e()H%e<
v0 J<s
   AAr6   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_constructorF
  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   1rw   r  Or+   z<^Given date string "1" not likely a datetime, at position 1$rf   r  )	r   r   r.   r/   r2   rG   ri   rj   rk   )r4   r$   r6   r7   r
  s        r#   $test_to_datetime_unprocessable_input7TestToDatetimeMisc.test_to_datetime_unprocessable_inputK
  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 )Nrg  d   rw   r  r   )r4   r$   seriesr6   s       r#   !test_to_datetime_unhashable_input4TestToDatetimeMisc.test_to_datetime_unhashable_inputV
  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]r/  r   )r.   r  viewr  r   r   )r4   r<  as_objr	  r   s        r#   'test_to_datetime_other_datetime64_units:TestToDatetimeMisc.test_to_datetime_other_datetime64_units[
  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 )NrB   r  r  )r   r   rI   r  asi8r2   r3   )r4   rngintsr6   s       r#   !test_to_datetime_list_of_integers4TestToDatetimeMisc.test_to_datetime_list_of_integersf
  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 overflowrf   z1/1/1700Br  )startr  r  )ri   rj   r   r   r4   r
  s     r#   r;  ,TestToDatetimeMisc.test_to_datetime_overflowp
  s1     O]]/s;Zc6B <;;rb  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 formatrf   r  r  )r.   r/   r0   ri   rj   rk   r   )r4   r$   invalids      r#   test_string_invalid_operation0TestToDatetimeMisc.test_string_invalid_operationw
  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 )	NrB   rC   z1/4/2000r+   r   r   r   r   )r.   r/   rh   r0   empty	enumerater   r   r	   r   array_to_datetimer2   r]  r   r9  r   assert_numpy_array_equalrI   )r4   r$   stringsr7   rR  r   r6   rL  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+   rI  rf   r  r  rw   )r.   r/   rh   r0   ri   rj   rk   r   r   r2   r3   )r4   r$   	malformedr
  r6   r7   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)rg  rt  cr  erB   rD   z1/5/2000r   r	  r"  r   rU   r   r+   r  F)check_names)r   r.   rh   r   rN  r  r  r   r   r2   rZ   r"  )
r4   r$   idxr4  dseriesr6   dresultr7   rR  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  rK  rq  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   )rc  rd  r  )r.   r,   r   rI   r  r   r2   r3   )r4   r$   r  r,   baserI   	exp_dtyper7   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  rd   r   r  r   Tr  r  )	r   r   r.   r/   r   r   r   r2   r3   )
r4   r$   r5   r7   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*  Trl  rf   F)r   r   r2   r3   r  rz  )r4   warning_msgr5   r7   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)Nrv  z
03/30/2011zI^time data "03/30/2011" doesn\'t match format "%d/%m/%Y", at position 1. r  rf   Trl  )ri   rj   rk   r  r   )r4   r5   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   r2   rG   )r4   r  r  r7   objr6   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  ri   r*  r+  r  r  r  r  r  r  r  r  r  r,  r  r  r  r/  r0  r  r  r  r  r  r  r"  r'  r   r   r+  r0  r5  r:  r@  r;  rK  rS  rW  ra  ri  rs  rz  r}  r   r   _from_sequencer  r3  r%  r%   r#   r  r  9	  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+   )r.   r/   r0   tools _guess_datetime_format_for_array)r4   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 )Nr/  r+   )r  r  r.   r/   rh   )r4   format_for_string_of_nanss     r#   -test_guess_datetime_format_for_array_all_nansETestGuessDatetimeFormat.test_guess_datetime_format_for_array_all_nans5  sB    $)$J$JHHbffbffbff-S9%
! )000r%   r%  N)r&  r'  r(  r)  ri   r*  r+  r.   rh   r  r/  r0  r  r3  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)TestToDatetimeInferFormati=  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   rc  r  r  c                 &   > U R                  T5      $ r`  )strftime)r]   r  s    r#   rd  dTestToDatetimeInferFormat.test_to_datetime_infer_datetime_format_consistent_format.<locals>.<lambda>F  s    ajj.Er%   rE   r   )r   r   rX   r   r2   rZ   )r4   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_format>  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  rf   r   )r   r.   r/   r  ri   rj   rk   r   )r4   r$   r   r\   r
  s        r#   $test_to_datetime_inconsistent_format>TestToDatetimeInferFormat.test_to_datetime_inconsistent_formatO  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   r.   r/   r   r2   rZ   )r4   r$   r   r\   r6   r7   s         r#   "test_to_datetime_consistent_format<TestToDatetimeInferFormat.test_to_datetime_consistent_formatY  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   r.   r/   rh   r0   r   r   r2   rZ   rz   s        r#   !test_to_datetime_series_with_nans;TestToDatetimeInferFormat.test_to_datetime_series_with_nansb  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  rz   s        r#   'test_to_datetime_series_start_with_nansATestToDatetimeInferFormat.test_to_datetime_series_start_with_nanso  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  r2   rZ   )r4   tz_namer  r\   r6   r   r7   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   r1  r  r   r2   rZ   )r4   r  zero_tzr\   r6   r   r7   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%   rF   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-03rE   rJ  )r4   r$   rF   r\   r7   r6   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 deprecatedrf   z
10-10-2000T)infer_datetime_format)r2   r  rz  r   rr  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)  ri   r*  r+  r  r  r  r  r  r  r  r  r  r3  r%  r%   r#   r  r  =  s    [[S<<*111( [[51	1 [[	
11 [[Xj'9:1 ;1Dr%   r  c                   v   \ 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34SSS\	 S34SSS\	 S34SSS\	 S34SSS\	 S34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   ry   rF   r$   )r   r   )r4   r$   rO   rF   s       r#   test_day_not_in_month_coerce,TestDaysInMonth.test_day_not_in_month_coerce  s     KHVQRRRRr%   c                     Sn[         R                  " [        US9   [        SSUS9  S S S 5        g ! , (       d  f       g = f)Nz8day is out of range for month: 2015-02-29, at position 0rf   r  r  r  r|  r\  s      r#   test_day_not_in_month_raise+TestDaysInMonth.test_day_not_in_month_raise  s-    H]]:S1WEB 211rb  zarg, format, msgz/^day is out of range for month, at position 0. 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)Nrf   r  r  r|  )r4   r$   rO   rF   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 )Nrw   r  r   )r4   r$   r7   rF   r6   s        r#   test_day_not_in_month_ignore,TestDaysInMonth.test_day_not_in_month_ignore  s     XhvS!!!r%   r%  )r&  r'  r(  r)  ri   r*  r+  r  r  r  r  r  r3  r%  r%   r#   r  r    sz    [[4 :&:&:&		
SSC
 [[ A/ARRST A/ARRST ""1!2!5 ""1!2!5 A/ARRST A/ARRST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2011Q3rl  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>  rU   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   r.   r/   r0   r   r   r   r   r2   r3   r   )r4   r&  r7   r$   r  rb  _rL  rM  rN  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   r2   r3   )r4   r$   unique_nulls_fixtureunique_nulls_fixture2r7   r6   s         r#   test_na_values_with_cache5TestDatetimeParsingWrappers.test_na_values_with_cacheY  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   )r4   rb  r  rL  rM  rN  s         r#   test_parsers_nat,TestDatetimeParsingWrappers.test_parsers_nata  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   )r4   r$   r&  r  r  r7   dateutil_resultrb  r  rL  rM  rN  s               r#   test_parsers_dayfirst_yearfirst;TestDatetimeParsingWrappers.test_parsers_dayfirst_yearfirstl  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   )
r4   r&  exp_defexp_nowrb  r  rL  rM  rN  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  rB  repr)r4   r$   	dt_stringr   dt_string_reprrg  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)  ri   r*  r+  r   r  r  r  r
  r  r   r   r  r3  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  rK  rq  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      $ )NrU   )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    rb  to_datetime64rY   )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_daterI   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:41rN   )r4   r  r7   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%  r2   rZ   )r4   r&  r6   r7   s       r#   test_julianTestOrigin.test_julian)  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   rd   r  r
  r  z
1970-01-01r  rQ  r   r+   rD  r   s      r#   	test_unixTestOrigin.test_unix3  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|% r-  r  r  r  z&1 is Out of Bounds for origin='julian'rf   r   )r   r%  ri   rj   rk   )r4   r6   r
  s      r#   test_julian_round_trip!TestOrigin.test_julian_round_trip;  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'rf   r-  r  r|  )r4   r  r&  r
  s       r#   test_invalid_unitTestOrigin.test_invalid_unitD  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 specifiedrf   z
2005-01-01r  r4  r|  )r4   r  r
  s      r#   test_invalid_originTestOrigin.test_invalid_originK  s/     9]]:S1\E 211rb  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 )Nr=  r   rU   r+   r  r  )
r   r.   rL  r  r   r   	Timedeltar   r2   rZ   )r4   r  r#  r  r  r]   r7   r6   s           r#   
test_epochTestOrigin.test_epochR  s{     tQ*
IIarxx8?PQ?P!R\\!(:5?PQ
 $5&QR
v0	 Rs   !Bzorigin, excr  rB  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 overflowrf   r  )r  ri   rj   r   )r4   r  excr  r  r
  s         r#   test_invalid_originsTestOrigin.test_invalid_originse  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-naiverf   r   r  r   r   r  )ri   rj   rk   r   r   r1  r  rr  s    r#   test_invalid_origins_tzinfo&TestOrigin.test_invalid_origins_tzinfoy  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 1rf   r  	yesterdayr|  rE  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 0rf   z2417-10-10 00:00:00r   r  )r4   rF   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)rP  
1870-01-012069-11-13 00:00:00)鼫 rQ  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  rP  rQ  rR  rS  rT  rN   )r4   rO   r  expected_strr6   r7   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  NrY  )-01:00Tz2019-01-01T01:00:00.000Z)rZ  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  r2   r3   )r4   r  r  r   rO   r6   r7   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*  r.  r1  r5  r8  ri   r*  r+  r;  r   r   r.   r  r@  rk   r   rD  rG  rK  rz  rN  rW  r\  r3  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   rd   r   r   rU   r'  rl  r  r  r   F)
r   r   r   r   r   rU   r'  rl  r  r  Tc                 N    [         R                  " U[        U5      SS9U:X  d   eg )Ngffffff?)check_countunique_share)r  should_cachery  )r4   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   rd   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)NrU   r   rf   )ri   rj   AssertionErrorr  rc  )r4   rb  ra  err_messagerO   s        r#   test_should_cache_errors(TestShouldCache.test_should_cache_errors  s9     cBh]]>=s+> >==s   A
Ard  r  r  c                 :    [         R                  " U5      SL d   eg )NT)r  rc  )r4   rd  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)  ri   r*  r+  rf  rk  r   r   r  rn  r3  r%  r%   r#   r_  r_    s    [[+U3+T2	


 [[/OE	
?? [[I345:;-./"4I345:;	
44r%   r_  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   rd   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   r.   r  r2   rZ   )r\   ser_copyr:  r7   s       r#   !test_nullable_integer_to_datetimers    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 datetimerf   r   )r9  r   ri   rj   rV  r   r   )nulls_fixturer  r6   s      r#   test_na_to_datetimerv    se    -))]]9,IJ}o./ KJ UM?34ayC KJs   A,,
A:ry   r  zargs, format)z
03/24/2016z
03/25/2016r  r>   )
2016-03-24
2016-03-25r  r   rR  rQ  rS  c                 |    [        U5      n[        X2U S9n[        SS[        /SS9n[        R                  " XT5        g )Nr   rw  rx  r  r+   )r   r   r   r2   rZ   )ry   rh  rF   r/  r6   r7   s         r#   test_empty_string_datetimerz    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  r9  r   r  r+   r  r  r6   r7   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  ra   r   r  r2   rZ   )r$   cstarttimesr6   r7   s        r#   +test_to_datetime_monotonic_increasing_indexr  &  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   rU   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)ry   r  rw   r  rf   r  )r   r   fromisoformatr0   r   r   r   r2   rZ   ri   rj   r   )r  r\   rb  	expected1rL  r~  s         r#   2test_to_datetime_cache_coerce_50_lines_outofboundsr  2  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>  rd   r  r   r   r   i  )r"  r#  r$  r%  r&  rp  microsecond
nanosecondrN   )r  timestamp_formatr6   r7   s       r#   %test_to_datetime_format_f_parse_nanosr  R  sG    /I-<F	H r%   c                  b    [        SS/SS9n [        SS/5      n[        R                  " X5        g )NrV  z2020-01-01 05:00:00rQ  r   r  r  r|  s     r#   test_to_datetime_mixed_iso8601r  d  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 2000rH  r   z
2000-01-11z
2000-01-12r  r|  s     r#   test_to_datetime_mixed_otherr  k  s1    ,(9:7KFlL9:H&+r%   r   rF   rH  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'rf   rV  )r   rF   r|  )r   rF   r
  s      r#   #test_to_datetime_mixed_or_iso_exactr  r  s0     EC	z	-\N%? 
.	-	-rb  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 1rf   rV  
01-01-2000rQ  r   r|  r%  r%   r#   4test_to_datetime_mixed_not_necessarily_iso8601_raiser  z  s5    	U
 	\<0C
 
 
rf  )ry   r7   r   r  rw   rV  r  r+   c                 J    [        SS/SU S9n[        R                  " X!5        g )NrV  r  rQ  r   r   )ry   r7   r6   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 deprecatedrf   )r2   r  r	  r   r   r3   )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   rd   z	[pyarrow]r+   r  )ri   r  r   lowerr   r2   rZ   )any_numeric_ea_dtyper\   r6   r7   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  rH  r   r   rI  r+   )r   r   r   r2   r3   r   )rK  r6   r7   r1  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  rf   )r  z2020-01-01 00:00+02:00r  rH  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 timezonerf   rH  r   )r   ri   rj   rk   r   r   )r  r  r5   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:00rI  rH  r   r  )r  r  r5   rx  ry  res3res4r7   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                  $ r`  r[  r&  rc  s    r#   rd  rd        $q'""r%   	naive_valic                 ,    [        U 5      R                  $ r`  r  rc  s    r#   rd  rd    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 datetime64rf   Tr  z!time data .* doesn't match formatz3time data \"2020-01-01 00:00\" doesn't match formatz1unconverted data remains when parsing with formatrH  r   z!DatetimeIndex has mixed timezones)r9  rY   rg  ra   nextr   ri   rj   rk   r   r	  r2   r  r	  rV  r   )
r  r  r  rK  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))i__doc__r   collectionsr   r   r   r   r   decimalr   r-  dateutil.parserr	   dateutil.tz.tzr
   numpyr.   ri   r1  pandas._libsr   pandas._libs.tslibsr   r   pandas.errorsr   r   pandas.util._test_decoratorsutil_test_decoratorsr/  pandas.core.dtypes.commonr   pandasr   r   r   r   r   r   r   r   r   r   pandas._testing_testingr2   pandas.core.arraysr   pandas.core.toolsr   r  pandas.core.tools.datetimesr   r  r*  r  
pytestmarkr  r$   r'   r5  r  ri  r  r  r  r  r  r  r  r  r#  r&  r(  r_  rs  r+  r/   r  rv  rz  r}  r  r  r  r  r  r  r  r0   r  r  r  r  r  r  r  r  r  r  r  r   ra   r  r%  r%   r#   <module>r     sr         ! #     * ) < 
 
 
  , 0 8  [[''8

 e}% &s0 s0l{) {)|'o@ o@d	G1 G1Tc* c*L1 1<wD wDtI" I"X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,5VDE,,: -*
&*" 	!u GH
Ie"  
 
3BZ%rwwy"''288U288_U"  
 u6S# 7 IS#r%   