
    A>i-                       S r SSKrSSKJr  SSKJrJrJrJr  SSKJ	r	  SSK
r
SSKrSSKJ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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K0J1r1  SSK2J3r4  SSK5J6r6  Sr7\(       a  Sr8Sr9OSr8Sr9 " S 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      r@ " S# S$5      rA " S% S&5      rB\R                  " / S'QS(9S) 5       rD\R                  S* 5       rE " S+ S,5      rF " S- S.5      rGS/ rH\R                  R                  S0\R                  \L/5      S1 5       rM\R                  R                  S2S3S4/5      \R                  R                  S5/ S6QS74/ S8QS94/S:S;/S<9S= 5       5       rNS> rOS? rP\R                  R                  S@SA\6\6SB-   \6SC-   /5      SD 5       rQSE rRSF rSSG rT\R                  R                  SHSISJ/5      \R                  R                  SKS;SL/5      SM 5       5       rUSN rVSO rWSP rXSQ rYSR rZSS r[ST r\SU r]SV r^SW r_SX r`SY raSZ rbS[rc\)" \c5      rd\R                  R                  S\5      \R                  R                  S]\c\)" \c5      /S^ S<9\R                  R                  S_\cSS` \dR                  S5      \dR                  5       \dR                  \dR                  \i" \dR                  5      /Sa S<9\R                  R                  SbSISJ/5      Sc 5       5       5       5       rjSd rkSe rlg)fztest to_datetime    N)deque)datedatetime	timedeltatimezone)Decimal)parse)tslib)iNaTparsing)PY314WASM)OutOfBoundsDatetimeOutOfBoundsTimedelta)is_datetime64_ns_dtype)		DataFrameDatetimeIndexIndexNaTSeries	Timestamp
date_rangeisnato_datetime)DatetimeArray)	datetimes)start_caching_ata_  You might want to try:\n    - passing `format` if your strings have a consistent format;\n    - passing `format=\'ISO8601\'` if your strings are all ISO8601 but not necessarily in exactly the same format;\n    - passing `format=\'mixed\'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.z, not 99zIday \d{1,2} must be in range 1\.\.\d{1,2} for month \d{1,2} in year \d{4} zday is out of range for monthc                      \ rS rSrS 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\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%/\" S5      \R"                  \R"                  \R"                  //SS$S%\R"                  /\" S5      \R"                  \R"                  \R"                  //S&\R"                  S'S(/\" S)5      \R"                  \R"                  \R"                  //S&S'\R"                  S(/\" S)5      \R"                  \R"                  \R"                  ///5      S* 5       r\R                  R                  S+\R,                  /S,S-/4\R,                  /S.S-/4\R,                  S//S,S-S0/4S1\R,                  /S2S3S-/4S1\R,                  /S4S5S-/4S.\R"                  \R,                  /S./ S6Q4S.\R"                  \R,                  /S7/ S6Q4/5      S8 5       rS9 rS: rS; r\R                  R                  S<S=S>\" S?5      /S@SA\" SB5      /SCSD\" SE5      /\R6                  " SFSG\" SH5      \R                  R9                  \R<                  " 5       SI   SJ;   SKSLSM9SN9\R6                  " SOSG\" SP5      \R                  R9                  \R<                  " 5       SI   SJ;   SKSLSM9SN9\R6                  " SQSR\" SS5      \R                  R9                  \R<                  " 5       SI   SJ;   SKSLSM9SN9/5      ST 5       r\ RB                  SU 5       r"\R                  R                  SSV\" SWSXSY5      4SZ\" SWSYSX5      4S[\" SWSXSYS\5      4S]\" SWSYSXS\5      4S^\" SWSXSYS\S_5      4S`\" SWSYSXS\S_5      4Sa\" SWSXSYS\S_Sb5      4Sc\" SWSYSXS\S_Sb5      4Sd\" SWSXSYS\S_SbSe5      4Sf\" SWSYSXS\S_SbSe5      4Sg\" SWSXSYS\S_SbSeShSi94Sj\" SWSYSXS\S_SbSeShSi94/5      Sk 5       r#\R                  R                  Sl/ SmQ5      Sn 5       r$\R                  R                  So/ SpQ/ SqQ/5      Sr 5       r%\R                  R                  SsStSu/Sv-  \" SwSxSi9/Sv-  /SySz/Sv-  \" Sw\&" \'" S{S|95      S}9/Sv-  /S~S/Sv-  \" Sw\&" \'" S{S|95      S}9/Sv-  /S~SS/\" Sw\&" \'" SIS|95      S}9\" Sw\&" \'" SIS|95      S}9///5      S 5       r(\R                  R                  SsSt/ SQ\" SwSxSi9\" SwSSi9\" SwSSi9//S~SS/\" Sw\&" \'" S{S|95      S}9\" Sw\&" \'" SS|95      S}9///5      S 5       r)S r*\R                  R                  S/ SQ5      S 5       r+S r,Sr-g.)TestTimeConversionFormatsJ   c                     [         R                  " / [        S9nUR                  US9  [	        U5      n[	        / 5      n[
        R                  " X45        g )Ndtype)write)nparrayobjectsetflagsr   tmassert_index_equal)selfwritablearrresultexpecteds        b/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pandas/tests/tools/test_to_datetime.pytest_to_datetime_readonly3TestTimeConversionFormats.test_to_datetime_readonlyK   sA    hhr(8$S!r?
f/    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formatcache)r   r*   assert_equal)r,   rB   index_or_seriesrA   r0   valuesr/   s          r1   test_to_datetime_format1TestTimeConversionFormats.test_to_datetime_formatS   s1     !!EFV%@"8,
)r4   zarg, expected, format)r=   r6   r5   )r=   r6   r9   )r>   r7   r5   )r>   r:   r9   )r?   r8   r5   )r?   r;   r9   c                 <    [        X$US9n[        U5      nXS:X  d   eg Nr@   r   r   )r,   rB   argr0   rA   r/   s         r1   test_to_datetime_format_scalar8TestTimeConversionFormats.test_to_datetime_format_scalarf   s&     Su=X&!!!r4   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%dr@   r   applystrr   r   r*   assert_series_equalr,   rB   serxr0   r/   s         r1    test_to_datetime_format_YYYYMMDD:TestTimeConversionFormats.test_to_datetime_format_YYYYMMDDv   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-  -   SS9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)NrO   rP   rQ   floatr#   1980122219810105M8[us]   rR   r@   natzBunconverted data remains when parsing with format "%Y%m%d": ".0". match)r   r   r&   nanr   r*   rV   rT   rU   pytestraises
ValueError)r,   rB   rX   r0   r/   ser2s         r1   )test_to_datetime_format_YYYYMMDD_with_natCTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_with_nat   s    h)XJN:'Jz"Ij$9:$%)*

 ffAS?
v0 yy~Q]]T
 XU;
 
 
s   <C
Cc                    [        SS/S/S-  -   SS9n[        [        S5      [        S5      /[        S5      /S-  -   SS9n[        R                  US	'   [        R                  US	'   [	        US
US9n[
        R                  " XC5        g )Ni| i rQ   r]   r#   1980120119810101r`   ra   %Y%mr@   )r   r   r&   re   r   r*   rV   )r,   rB   rX   r0   r/   s        r1   'test_to_datetime_format_YYYYMM_with_natATestTimeConversionFormats.test_to_datetime_format_YYYYMM_with_nat   s     ff%14GDz"Ij$9:$%)*

 ffASu=
v0r4   c                     [        / SQ5      n[        USSUS9n[        [        R                  " / SQSS9SS9n[        R
                  " X45        g )	N)3T3irR   raiserA   errorsrB   )z
2012-12-31
2014-12-31z
9999-12-31M8[s]r#   r`   )r   r   r&   r'   r*   rV   r,   rB   rX   r/   r0   s        r1   +test_to_datetime_format_YYYYMMDD_oob_for_nsETestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_oob_for_ns   sK     34S'OHH?wO
 	v0r4   c                 z    [        / SQ5      n[        USSUS9n[        / SQSS9n[        R                  " X45        g )N)rs   rt   l   ]'l
F3YHqS rR   coercerv   )2012123120141231r   r`   r#   r   r   r*   rV   rz   s        r1   )test_to_datetime_format_YYYYMMDD_coercionCTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_coercion   s:     LMS(%P9J
v0r4   input_s)r^   20010112Nr^   r   )r^   r   r   )rO   T1NrO   r   )rO   r   r   c                     [        [        S5      [        S5      [        /5      n[        [        USS95      n[        R
                  " X25        g )Nr^   r   rR   rA   )r   r   r   r   r*   rV   r,   r   r0   r/   s       r1   *test_to_datetime_format_YYYYMMDD_with_noneDTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_with_none   s>    & 9Z0)J2GMNGH=>
v0r4   zinput_s, expected2001001210019999i]4iT1i{120190813c                 r    [        U5      n[        USSS9n[        U5      n[        R                  " X25        g )NrR   r~   rA   rw   r   r   s       r1   )test_to_datetime_format_YYYYMMDD_overflowCTestTimeConversionFormats.test_to_datetime_format_YYYYMMDD_overflow   s3    8 /WXhG(#
v0r4   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   rR   c                 X    [        XS9n[        U5      n[        R                  " XC5        g Nr   r   r   r*   r+   )r,   datarA   r0   r/   s        r1   test_to_datetime_with_NA2TestTimeConversionFormats.test_to_datetime_with_NA   s&    $ T1 *
f/r4   c                     [        S[        R                  /5      n[        SS/5      n[        R
                  " X5        g )Nr   r   r   )r   pdNAr   r*   r+   r,   r/   r0   s      r1   %test_to_datetime_with_NA_with_warning?TestTimeConversionFormats.test_to_datetime_with_NA_with_warning
  s2    h./ ,!67
f/r4   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%Yr@   )iA i i    -ro   rS   rW   s         r1   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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.%fr@   )calendar
month_abbrr   r   strptime)r,   rB   r   valrA   r/   exps          r1   #test_to_datetime_format_microsecond=TestTimeConversionFormats.test_to_datetime_format_microsecond  sL    ((+
J<12'Su=,}}r4   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.utf8F)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 rI   r   )r,   rB   valuerA   dts        r1   test_to_datetime_format_time6TestTimeConversionFormats.test_to_datetime_format_time'  s    Z 5u=CCCr4   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rA   exactrB   z(\d+\w+\d+))expandr@   )r   r   rU   extractr*   rV   rz   s        r1   test_to_datetime_with_non_exact9TestTimeConversionFormats.test_to_datetime_with_non_exactV  sV    
 Q
 SeLGGOON5O9(RW
 	v0r4   %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rA   r   r   )r,   rB   rA   r0   r/   s        r1   (test_non_exact_doesnt_parse_whole_stringBTestTimeConversionFormats.test_non_exact_doesnt_parse_whole_stringd  s#    4 .vU
 !!!r4   rK   )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rB   r   r@   r   )r,   rB   rK   r0   r/   s        r1   #test_parse_nanoseconds_with_formula=TestTimeConversionFormats.test_parse_nanoseconds_with_formula  s)     s0S)?uM!!!r4   zvalue,fmt,expected)2009324z%Y%W%wz
2009-08-13)2013020z%Y%U%wz
2013-01-13c                 6    [        XUS9[        U5      :X  d   eg rI   rJ   )r,   r   fmtr0   rB   s        r1   test_to_datetime_format_weeks7TestTimeConversionFormats.test_to_datetime_format_weeks  s     5E:i>QQQQr4   zfmt,dates,expected_datesz%Y-%m-%d %H:%M:%S %Z2010-01-01 12:00:00 UTCra   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   r*   rC   )r,   r   datesexpected_datesr/   r0   s         r1   )test_to_datetime_parse_tzname_or_tzoffsetCTestTimeConversionFormats.test_to_datetime_parse_tzname_or_tzoffset  s%    X U/(
)r4   )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  S S S 5        g ! , (       d  f       g = f)N6Mixed timezones detected. Pass utc=True in to_datetimerc   r   rf   rg   rh   r   )r,   r   r   r   msgs        r1   ;test_to_datetime_parse_tzname_or_tzoffset_utc_false_removedUTestTimeConversionFormats.test_to_datetime_parse_tzname_or_tzoffset_utc_false_removed  s-    D G]]:S1* 211   
/
=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rA   utcr   )r,   r   r   r   r/   r0   s         r1   =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/r4   offset)z+0z-1fooUTCbarz:10z
+01:000:01r   c                     SnSU-   nSR                  S[         S3S[         S3/5      n[        R                  " [        US9   [        U/US9  S S S 5        g ! , (       d  f       g = f)	Nr   z2010-01-01 12:00:00 |z,^time data ".*" doesn\'t match format ".*". $?^unconverted data remains when parsing with format ".*": ".*". rc   r   joinPARSING_ERR_MSGrf   rg   rh   r   )r,   r  r   r   r   s        r1   )test_to_datetime_parse_timezone_malformedCTestTimeConversionFormats.test_to_datetime_parse_timezone_malformed  sl     %%.hh??BSSTUR"#1&
 ]]: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   r*   r+   )r,   r   rK   r/   r0   s        r1   *test_to_datetime_parse_timezone_keeps_nameDTestTimeConversionFormats.test_to_datetime_parse_timezone_keeps_name  sA    $,-E:S- "7!8UO
f/r4    ).__name__
__module____qualname____firstlineno__r2   rf   markparametrizer   rF   rL   rZ   rj   rp   r{   r   r&   re   r   r   r   r   r   r   r   r   r   paramxfaillocale	getlocaler   tdskip_if_not_us_localer   r   r   r   r   r   r   r   r  r  r  __static_attributes__r  r4   r1   r    r    J   s   0 [[ :&	*(=y?TU
 :&	*(=y?TU		
** [[000000	

"
"
1<61	11 [[ +RVV,S)+&x(x%'	
11 [[ RVVZ<:&? ZRVV<:&? 2668X6:&? 8RVVX6:&?#	
21321 [[ eeWnug.eeWdUG$()-.
 <*?@<*?@BFFBEE"D*?@BFFBEE"H.CD	
 0! 001 [[!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	
."/." [[	
	"	" [[//	
RR [[" '*+a/0U;<q@ &+,q0-hyQS?T6U
 	 ',-1-hyQS?T6U
 	 '(*AB-hyQR?S6T -hyQR?S6T	5&	
)T*U)T* [[" ' 3>3>3E ',.IJ-hyQS?T6U -hyQT?U6V		
<+=<+0( [[D,,0r4   r    c                      \ rS rS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      R!                  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/S0S.9\/S1S9\R                  " S\" S,S-S.9\" S2S0S.9\/S3S9/5      S4 5       r\R                  R                  S+\R                  " S\" / S5QSS9S6S9\R                  " S\" / S7QSS9S8S9/5      S9 5       r\R                  R                  SSS/SS/S9\R                  R                  S:\R                  " SS;/S<S9/5      \R                  R                  S&\S= /5      S> 5       5       5       rS? r\R                  R                  S@SASB\" SCSDSESFSF5      /SGSB\" SHSISISFSF5      /SJSB\" SHSISKSFSF5      /SLSB\" SMSDSNSFSF5      /SOSB\" SMSDSESFSF5      /SPSB\" SMSDSQSFSF5      /SRSB\" SSSDSTSFSF5      //5      SU 5       r\R                  R                  SV/ SWQ/ SXQ/5      SY 5       r\R                  R                  SV/ SZQ/ S[Q/ S\Q/ S]Q/ S^Q/ S_Q/ S`Q/ SaQ/ SbQ/ ScQ/ SdQ/ SeQ/ SfQ/ SgQ/ ShQ/ SiQ/ SjQ/ SkQ/ SlQ/5      \R                  R                  SmSnSo/5      Sp 5       5       r\R                  R                  SqSrSs/5      St 5       r\R>                  \R                  R                  SuSS/5      \R                  R                  SqSrSs/5      Sv 5       5       5       r Sw r!Sx r"\R>                  \R                  RG                  \$SySz9S{ 5       5       r%\R>                  \R                  RG                  \$SySz9\R                  R                  SqS|S}/5      S~ 5       5       5       r&\R                  R                  SSS/5      S 5       r'\R                  R                  S5      \R                  RG                  \$SySz9\R                  R                  S/ SQ5      \R                  R                  SSS/5      S 5       5       5       5       r(\R                  R                  S\)RT                  " S5      \)RT                  " S5      /5      S 5       r+\R                  R                  SSS/5      S 5       r,\R                  R                  S\)RT                  " S5      \)RT                  " S5      /5      \R                  R                  SmSnSo/5      S 5       5       r-S r.\R                  R                  SSS/5      S 5       r/S r0S r1S r2S r3\R                  R                  S\4\4\5\4\)Rl                  \4\7\74/5      S 5       r8\R                  R                  SS\" SSuS.9/S\" SSuS.9//5      S 5       r9S r:S r;\R                  R                  SSS/5      S 5       r<S r=\R                  R                  SSS/5      S 5       r>S r?\R                  R                  S\@\A/5      S 5       rB\R                  R                  SmSoSn/5      S 5       rC\R                  R                  SSS/5      \R                  R                  SSrS/5      S 5       5       rD\R                  R                  SS/5      \R                  R                  SSrS/5      S 5       5       rE\R                  R                  SS/S// SQ/5      \R                  R                  SSrS/5      S 5       5       rF\R                  R                  SuSSr/5      \R                  R                  SSSr/5      \R                  R                  S&\5\G\)Rl                  \4\H/5      S 5       5       5       rIS rJ\R                  R                  SuSSr/5      \R                  R                  SSSr/5      S 5       5       rKS rL\R                  R                  SSr\)R                  4\4\N-  -   \4\NS-   -  S4Sr\" S5      R!                  S5      4\4\N-  -   \\" S5      R!                  S5      4\4\N-  -   S4S\4\N-  -   S\" S5      4-   \4\NSI-   -  \" S5      \" S5      4-   S!445      S 5       rO\R                  R                  S\7" \/S-  Sr/S-  -   SS9\7" \/S-  Sr/S-  -   SS9\7" Sr/S-  5      \7" Sr/S-  5      \7" S/S-  5      \7" S/S-  5      \7" \PR                  /S-  5      \7" \PR                  /S-  5      \7" \)R                  /S-  5      \7" \)R                  /S-  5      /
5      S 5       rR\R                  R                  S/ SQ5      S 5       rSS rT\R                  R                  SSS/5      \R                  R                  S\" SSISI5      \U" SSISI5      \)RT                  " S5      SS/5      S 5       5       rVS rWS rXS rYS rZS r[S 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 ra\R                  R                  SSS/S\" SSS.9/S\" SSSISIS5      R                  \cR                  " S5      5      //5      S 5       reSrfgr)TestToDatetimei"  c                 @   / SQn[        U Vs/ s H  n[        U5      R                  S5      PM     sn5      n[        U5      n[        R                  " XC5        [        USS9n[        R                  " XS5        [        USS9n[        R                  " Xc5        g s  snf )N)z2016-01-01 01:02:03z2016-01-01 01:02:03.001z2016-01-01 01:02:03.001002z2016-01-01 01:02:03.001002003nsISO8601r   mixed)r   r   as_unitr*   r+   r   )r,   valsrY   r0   result1result2result3s          r1   #test_to_datetime_mixed_string_resos2TestToDatetime.test_to_datetime_mixed_string_resos#  s    
 !d!Kd)A,"6"6t"<d!KL%
g0d95
g0d73
g0 "Ls   $Bc                 ,    [        S 5      [        L d   eg Nr   r   r,   s    r1   test_to_datetime_none$TestToDatetime.test_to_datetime_none6  s    4 C'''r4   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[        [        /SS9n[        R                  " X45        g ! , (       d  f       N= f! , (       d  f       Ne= f)N08335394550z+Parsing "08335394550" to datetime overflowsrc   r~   rw   ry   r#   )rf   rg   r   r   r   r   r*   r+   )r,   rK   r   resr   s        r1   test_to_datetime_overflow(TestToDatetime.test_to_datetime_overflow:  s    
 ;]].c: ; ]].c: ; #h/czz3%1SE)
c' ;: ;:s   B&B7&
B47
C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_convertr*   r+   )r,   d1d2r9  r0   s        r1   *test_to_datetime_mixed_datetime_and_string9TestToDatetime.test_to_datetime_mixed_datetime_and_stringM  s    dAq"Xyq7I6I-JKdAq"Xyq7I6I-JK3R89x(33HYs=S4TU
c,r4   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   r(  r   r   r   r   r*   r+   )r,   r*  rY   r0   r/   r,  r-  result4s           r1   )test_to_datetime_mixed_string_and_numeric8TestToDatetime.test_to_datetime_mixed_string_and_numericU  s    a  !=1)A,!=>T'2d4R4j9$B$?%TrT
+DbD1
f/
g0
g0
g0 ">s   CrA   r   r   r'  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   ra   
2020-01-01r   z
2020-01-02r`   r#   )r   r   r   r*   r+   )r,   rA   rB  r9  r0   s        r1   &test_to_datetime_mixed_date_and_string5TestToDatetime.test_to_datetime_mixed_date_and_stringc  sB    
 $1<,V< ,!=XN
c,r4   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[us, UTC]r#   zall tz-aware, with utc)idFz2000-01-01 01:00:00+00:002000-01-01 02:00:00+00:00usz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       $ r1  r   to_pydatetimerY   s    r1   <lambda>TestToDatetime.<lambda>      il88:r4   c                     U" US   5      nUS   n[        Xg/XS9nU[        L a  UR                  S5      n[        R                  " X5        g )Nr   r   r  rW  )r   r   r)  r*   r+   )	r,   r   r  argsr0   rY  ts1ts2r/   s	            r1   6test_to_datetime_mixed_datetime_and_string_with_formatETestToDatetime.test_to_datetime_mixed_datetime_and_string_with_formatm  sP    p $q'"1gcZ=)#''-H
f/r4   c                 4    [        U 5      R                  5       $ r1  r[  r]  s    r1   r^  r_    r`  r4   c                     SS/nU" US   5      nUS   nSn[         R                  " [        US9   [        XE/USS9  S S S 5        g ! , (       d  f       g = f)	NrX  rV  r   r   r   rc   Fr  r   )r,   r   rY  rb  rc  rd  r   s          r1   Mtest_to_datetime_mixed_dt_and_str_with_format_mixed_offsets_utc_false_removed\TestToDatetime.test_to_datetime_mixed_dt_and_str_with_format_mixed_offsets_utc_false_removed  sS    " &'BC$q'"1gF]]:S1
3E: 211   A
A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  S S S 5        g ! , (       d  f       g = f)Nr   rc   z2000-01-01 09:00:00+01:00z2000-01-02 02:00:00+02:00NFr  r   )r,   r   r0   r   s       r1   =test_to_datetime_mixed_offsets_with_none_tz_utc_false_removedLTestToDatetime.test_to_datetime_mixed_offsets_with_none_tz_utc_false_removed  s5    8 G]]:S1P 211	   3
A)2000-01-01 08:00:00+00:00z2000-01-02 00:00:00+00:00r   zISO8601, UTC)rq  z2000-02-01 00:00:00+00:00r   znon-ISO8601, UTCc                 J    [        / SQUSS9n[        R                  " X25        g )Nrm  Tr  r   r*   r+   )r,   r   r0   r/   s       r1   (test_to_datetime_mixed_offsets_with_none7TestToDatetime.test_to_datetime_mixed_offsets_with_none  s'    . L

 	f/r4   rb  z2000-01-01 02:00:00-07:00z*all tz-aware, mixed timezones, without utcc                 4    [        U 5      R                  5       $ r1  r[  r]  s    r1   r^  r_    r`  r4   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=Truerc   Fr  r   )r,   r   rb  rY  rc  rd  s         r1   =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:
 
 
rk  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   r*   r+   rV   )r,   r   rX   r   r9  r0   s         r1   test_to_datetime_np_str&TestToDatetime.test_to_datetime_np_str'  s     9:eWo4?5!S(((388A;'3...5'"#<
c,#(#
s-r4   zs, _format, dtz2015-1-1z%G-%V-%u  r      r   z2015-1-4  r   z2015-1-7r   z	2024-52-1i     z	2024-52-7z2025-1-1   z	2020-53-1r=     c                 "    [        XS9U:X  d   eg r   r   )r,   s_formatr   s       r1   %test_to_datetime_iso_week_year_format4TestToDatetime.test_to_datetime_iso_week_year_format;  s     1-333r4   zmsg, s, _format)z'Week 53 does not exist in ISO year 2024z	2024 53 1%G %V %u)z'Week 53 does not exist in ISO year 2023z	2023 53 1r  c                 |    [         R                  " [        US9   [        X#S9  S S S 5        g ! , (       d  f       g = f)Nrc   r   r   )r,   r   r  r  s       r1   test_invalid_iso_week_53'TestToDatetime.test_invalid_iso_week_53K  s&    " ]]:S1* 211s   
-
;)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  rw   ru   r~   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  rc   r   )r  r  rf   rg   rh   r   )r,   r   r  r  rw   s        r1   test_error_iso_week_year'TestToDatetime.test_error_iso_week_year_  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   )r,   r   dtir.   r/   s        r1   test_to_datetime_dtarr%TestToDatetime.test_to_datetime_dtarr  s1     rDiiS!}}r4   r  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  r&  )unitr   r  r   )rf   importorskipr   astyper   
ArrowDtype	timestampr   r   r*   rV   r+   )	r,   r   r  rD   par  	dti_arrowr/   r0   s	            r1   test_to_datetime_arrow%TestToDatetime.test_to_datetime_arrow  s       +rDc"JJr}}R\\t\-KLM	Y0s,33MM",,DsR,NO
 f4 &&&f$""64!!&3r4   c                 V    [        [        SSS5      5      nU[        SSS5      :X  d   eg )N  r      r   r   r,   actuals     r1   test_to_datetime_pydatetime*TestToDatetime.test_to_datetime_pydatetime  s,    XdAr23$2....r4   c                 @    [        S5      nU[        SSS5      :X  d   eg )N20080115r  r   r  r  r  s     r1   test_to_datetime_YYYYMMDD(TestToDatetime.test_to_datetime_YYYYMMDD  s#    Z($2....r4   ztzset is not available on WASMr   c                    [         R                  " S5         [        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       _B)r*   set_timezoner   r   abs_valuer   )r,   r  pdnowpdnow2s       r1   test_to_datetime_now#TestToDatetime.test_to_datetime_now  s     __\*E"C&E %)!,F u||cjj01D888v}}szz12T999<<'''==((( +**s   BB55
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      n[        R                  " 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[us]r   r  )r*   r  r&   
datetime64r  int64r   r   r  r  	normalizer  r   )r,   r   nptodaypdtodaypdtoday2tstodaytstoday2s          r1   test_to_datetime_today%TestToDatetime.test_to_datetime_today"  s&    __R mmG,334DELLRXXVG!'*G"G9-a0H(G (H w((*11G;<tCCCx))+22W<=DDDw~~67$>>>w~~784???>>)))??***! !  s   EE$$
E2rK   r  r  c                     [        U/5        g r1  r   )r,   rK   s     r1   (test_to_datetime_today_now_unicode_bytes7TestToDatetime.test_to_datetime_today_now_unicode_bytes>  s    SEr4   z8ignore:Timestamp.utcnow is deprecated:DeprecationWarningzformat, expected_ds))r   
2020-01-03)rS  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  zdatetime64[s, UTC]r#   r   )r   r   getattrr   maxtotal_seconds)r,   rA   expected_dsstring	attributer/   r0   s          r1    test_to_datetime_now_with_format/TestToDatetime.test_to_datetime_now_with_formatB  s]    * 4f=fRVW ')Y79:BV
 !&&(6681<<<r4   r   
2000-01-01
2000-01-02c                 4    [        X!S9[        U5      :X  d   eg )Nr   rJ   )r,   rB   r   s      r1   test_to_datetime_dt64s%TestToDatetime.test_to_datetime_dt64s]  s     2+y}<<<r4   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 )NrP  r   r  r   r&   r  r   r*   r+   )r,   rK   rA   r/   r0   s        r1   test_to_datetime_dt64s_and_str-TestToDatetime.test_to_datetime_dt64s_and_strc  s;     c2==#>?O ,!=>
f/r4   z
1000-01-01z
5000-01-02c                     [        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rw   rB   r  )r   
isinstancer   r  asm8)r,   rB   r   rw   tss        r1   'test_to_datetime_dt64s_out_of_ns_bounds6TestToDatetime.test_to_datetime_dt64s_out_of_ns_boundsp  sl     %8"i((((ww#~~ww"}}r]ww#~~ww"}}r4   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-27rc   ru   r  r~   )r&   r  iinfor  r  rf   rg   r   r   r   r   )r,   rB   dt64r   s       r1   $test_to_datetime_dt64d_out_of_bounds3TestToDatetime.test_to_datetime_dt64d_out_of_bounds  s    }}RXXbhh/33S9G]].c:dO ;]].c:WE: ; 4>#EEE ;:::s   B5C5
C
Cr  r  r  c                    [         R                  " SU5      [         R                  " SU5      /S-  n[        X1S9n[        U Vs/ s H  n[	        U5      R
                  PM     snSS9n[        R                  " XF5        / UQ[         R                  " S5      Pn[        USS	9  [        US
US9n[        [         R                  " USS95      n[        R                  " XF5        g s  snf )Nr  r  r  r   ry   r#   
9999-01-01ru   r8  r~   r  )	r&   r  r   r   r   r  r*   r+   r'   )r,   rB   r  dtsr/   rY   r0   dts_with_oobs           r1   test_to_datetime_array_of_dt64s.TestToDatetime.test_to_datetime_array_of_dt64s  s    
 MM,-MM,-
  S. S!AS)A,"3"3S!AQ
f/ ;:bmmL9: 	L1\(%H ,g!FG
f/ "Bs   C#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   r*   r+   )r,   rB   r.   r/   r0   s        r1   test_to_datetime_tz"TestToDatetime.test_to_datetime_tz  sR     0\B0\B
 S. "$9:|
 	f/r4   c                     [        SSS9[        SSS9/nSn[        R                  " [        US9   [	        X!S9  S S S 5        [	        X!S	S
9n[        SS/SS9n[        R                  " XE5        g ! , (       d  f       N;= f)Nr  r   r   r  r  zLTz-aware datetime.datetime cannot be converted to datetime64 unless utc=Truerc   r   r~   )rB   rw   z2013-01-01 13:00:00-08:00r   zdatetime64[us, US/Pacific]r#   )r   rf   rg   rh   r   r   r*   r+   )r,   rB   r.   r   r/   r0   s         r1   test_to_datetime_tz_mixed(TestToDatetime.test_to_datetime_tz_mixed  s     +=+=

6 	 ]]:S1) 2 Sh? (%08T
 	f/ 21s   
A//
A=c                     SnSnU/S-  U/S-  -   nSn[         R                  " [        US9   [        XAS9  S S S 5        g ! , (       d  f       g = f)NMarch 1, 2018 12:00:00+0400March 1, 2018 12:00:00+0500rQ   r   rc   r   r   )r,   rB   ts_string_1ts_string_2r.   r   s         r1   *test_to_datetime_different_offsets_removed9TestToDatetime.test_to_datetime_different_offsets_removed  sM     43ma;-!"33F]]:S1) 211s   
A  
Ac                 L   [         R                  " S5      nU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                  " XV5        g )Npytzr  r   r   r   r   )yearmonthdayhourminute   r#   Tr  rB   rq  2000-06-01 07:00:00+00:00rT  r$   r  )rf   r  r   r&   r'   localizer   r(   r   r   r*   r+   )r,   rB   r  
us_easternr.   r/   r0   s          r1   test_to_datetime_tz_pytz'TestToDatetime.test_to_datetime_tz_pytz  s    ""6*]]<0
hh##$aQQqI ##$aQQqI	 

 Sd%8 (*EF'

 	f/r4   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rA   r  rB   )r   r   r*   rC   )r,   rB   init_constructorend_constructorr   expected_datar/   r0   s           r1   test_to_datetime_utc_true(TestToDatetime.test_to_datetime_utc_true  s^     "#45+6+6

 T"?E
 #=1
)r4   zscalar, expectedr&  r(  r'  r)  c                 *    [        USSUS9nXC:X  d   eg )Nr*  Tr+  r   )r,   rB   scalarr0   r/   s        r1    test_to_datetime_utc_true_scalar/TestToDatetime.test_to_datetime_utc_true_scalar  s      VOUS!!!r4   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   r*   rV   )r,   rB   r  r/   r0   s        r1   2test_to_datetime_utc_true_with_series_single_valueATestToDatetime.test_to_datetime_utc_true_with_series_single_value	  s=    VRD\t5A9RE234
v0r4   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   r*   rV   )r,   rB   r  expected_tsr   r/   r0   s          r1   4test_to_datetime_utc_true_with_series_tzaware_stringCTestToDatetime.test_to_datetime_utc_true_with_series_tzaware_string  sQ    (+rdQhTt599[U;<q@A
v0r4   zdate, dtype)r9  datetime64[ns])r9  zdatetime64[ns, UTC]c                 ~    [        [        SSS9/SS9n[        [        U/US9SUS9n[        R                  " XT5        g )Nr9  r   r   zM8[ns, UTC]r#   Tr  r   r   r   r*   rV   )r,   rB   r   r$   r0   r/   s         r1   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0r4   c                 D   [         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R                  S5      n	[        U	5      (       a   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)rw   r  rB   rq  r  rT  r   z2000-01-01 08:00:00r   rW  r  z2000-01-01 13:00:00)rf   r  FixedOffsetTimezoner&   r'   r   r(   r   r   r*   r+   r)  r   )
r,   requestrB   psycopg2_tztz1tz2r.   r/   r0   is
             r1   test_to_datetime_tz_psycopg2+TestToDatetime.test_to_datetime_tz_psycopg2&  sH   ))-8 --T-E--T-Ehhq!Q#6q!Q#6 
 St5I (*EF'

 	f/ "#..d.F
 '$- 	
 *!,,,, Qxu=
f(QxTG "7!8@UV
f/r4   c                     Sn[         R                  " [        US9   [        U5        S S S 5        [        USUS9[        L d   eg ! , (       d  f       N#= f)Nz2dtype bool cannot be converted to datetime64\[ns\]rc   r~   r  )rf   rg   	TypeErrorr   r   )r,   rB   rK   r   s       r1   test_datetime_bool!TestToDatetime.test_datetime_boolL  sE     D]]9C0 1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 datetimerc   Fr   z2^time data "True" doesn\'t match format "%Y%m%d". r	  20130101Tr   g        r~   r  )typerf   rg   rM  r   r   r  rh   r  r*   r+   r   r   r,   rB   r   s      r1   test_datetime_bool_arrays_mixed.TestToDatetime.test_datetime_bool_arrays_mixedT  s    e<=]]9C0 01? 1]]E"#1&
 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 datetimerc   )rf   rg   rM  r   )r,   rK   r   s      r1   test_datetime_invalid_datatype-TestToDatetime.test_datetime_invalid_datatypeg  s+     /]]9C0 100   1
?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%rc   z00:00:00zH%:M%:S%r   r   )r,   rw   s     r1   test_invalid_format_raises)TestToDatetime.test_invalid_format_raisesn  s6     ]]J
 ZG
 
 
   0
>r   az00:01:99z%H:%M:%Sc                    [        USUS9nU[        L d   eSR                  S[         S3SS[         S3S[         S	3/5      n[
        R                  " [        US
9   [        USUS9  S S S 5        g ! , (       d  f       g = f)Nr~   rw   rA   r  1^time data "a" doesn\'t match format "%H:%M:%S". r	  -^Given date string "a" not likely a datetime$D^unconverted data remains when parsing with format "%H:%M:%S": "9". ^second must be in 0..59: 00:01:99$rc   ru   )r   r   r  r  NOT_99rf   rg   rh   r,   r   rA   r9  r   s        r1   test_datetime_invalid_scalar+TestToDatetime.test_datetime_invalid_scalarv  s     %@czzhhD"#1&@W"#1&+F8;?	
 ]]:S1gf= 211s   A22
B z3000/12/11 00:00:00c                 v   [        USUS9nUc)  [        U[        5      (       d   eU[        U5      :X  d   eOU[        L d   eUb0  Sn[        R
                  " [        US9   [        USUS9  S S S 5        g [        USUS9n[        U[        5      (       d   eU[        U5      :X  d   eg ! , (       d  f       g = f)Nr~   r`  z*^time data ".*" doesn\'t match format ".*"rc   ru   )r   r  r   r   rf   rg   rh   rg  s        r1    test_datetime_outofbounds_scalar/TestToDatetime.test_datetime_outofbounds_scalar  s     %@>c9----)E****#::?Cz5E'&A 65 eGFCCc9----)E**** 65s   !B**
B8rE   )r^  bz99:00:00c           	      H   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5      -  5      5        SR                  SS	[         S
3S[         S
3S[         S3/5      n[        R                  " [        US9   [        R                  " USSS9   [	        USUS9  S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       N(= f! , (       d  f       g = f)Nr   Could not infer formatFrd   raise_on_extra_warningsr~   r`  r  rb  ra  r	  rc  rd  re  rc   ru   )lenUserWarningr*   assert_produces_warningr   r+   r   r   r  r  rf  rf   rg   rh   )r,   rE   rA   warnr9  r   s         r1   test_datetime_invalid_index*TestToDatetime.test_datetime_invalid_index  s    >c&kAoDD''0%
 fXfEC
 	c=#V1D#EFhh@D"#1&W"#1&+F8;?	
 ]]:S1++4e F76B 21!
 
"  21s/   C1=DD D1
C?
D	D
D!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  rA   rB   Frs  )	r,   r  rA   rY  r   
test_datesr   r/   r0   s	            r1   test_to_datetime_cache%TestToDatetime.test_to_datetime_cache  sH     #Ve^
:&T6FtV5I
f/r4   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   r*   r+   r   s      r1   test_to_datetime_from_deque*TestToDatetime.test_to_datetime_from_deque  sE    UI.C$D#E#JKL	*? @ABFG
f/r4   c                     SnU/S-  n[        U5      n[        XQUSS9n[        XQUSS9n[        R                  " Xg5        g ry  r   )r,   r  rA   r   r|  r   r/   r0   s           r1   test_to_datetime_cache_series,TestToDatetime.test_to_datetime_cache_series  sH     #Ve^
j!T6FtV5I
v0r4   c                 @    Sn[        USS9n[        S5      nX#:X  d   eg )Nrz  Tr   rJ   )r,   r   r/   r0   s       r1   test_to_datetime_cache_scalar,TestToDatetime.test_to_datetime_cache_scalar  s*    "T.01!!!r4   z&datetimelikes,expected_values,exp_unitra   z
2012-07-26r1  z2012 July 26c                 t    [        USS9n[        USS9n[        USU S3S9n[        R                  " XV5        g )Nr(   r#   r~   r8  zdatetime64[]r   )r,   datetimelikesexpected_valuesexp_unitrX   result_seriesexpected_seriess          r1   *test_convert_object_to_datetime_with_cache9TestToDatetime.test_convert_object_to_datetime_with_cache  sK    8 
 $C9 z+
 	}>r4   input   r(   r   r   c                 x    [        [        /[        U5      -  SS9n[        X!S9n[        R
                  " XC5        g )Nry   r#   r   )r   r   rr  r   r*   rV   )r,   rB   r  r0   r/   s        r1   *test_to_datetime_converts_null_like_to_nat9TestToDatetime.test_to_datetime_converts_null_like_to_nat  s3    " 3%#e*,G<U0
v0r4   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 yearrc   r   r   )r,   r   rA   r   s       r1   'test_week_without_day_and_calendar_year6TestToDatetime.test_week_without_day_and_calendar_year   s+     =]]:S1, 211r   c                     / SQnSn[         R                  " [        US9   [        USS9  S S S 5        g ! , (       d  f       g = f)N)r  r  20100240r   rc   r~   r8  r   r,   
ts_stringsr   s      r1   test_to_datetime_coerce&TestToDatetime.test_to_datetime_coerce2  s5    


 G]]:S1
84 211s	   4
A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[        U[        5      (       aD  UR                  S5      UR                  S5      -  (       a  [	        [        SSS5      [        /SS	9nOD[        U[
        5      (       a  [	        [        SSS5      U/SS	9nO[	        [        SSS5      U/SS	9n[        R                  " XV5        g )
Nr~   r`  z%BJ  r   r   r`   r#   )	r   r  rU   
startswithr   r   r   r*   r+   )r,   
string_argrA   r  r  r/   r0   s          r1   test_to_datetime_coerce_oob*TestToDatetime.test_to_datetime_coerce_oob=  s      !.
ZHk3''d#k&<&<S&AA %htQ&:C%@QHX..$$1%{38H %$1%{38H 	f/r4   c                     SS/n[         R                  " [        SSS9   [        USS9nS S S 5        [	        [
        [
        /SS	9n[         R                  " WU5        g ! , (       d  f       N:= f)
N200622-12-31111111-24-11ro  Frp  r~   r8  ry   r#   )r*   rt  rs  r   r   r   r+   )r,   r  r/   r   s       r1   #test_to_datetime_malformed_no_raise2TestToDatetime.test_to_datetime_malformed_no_raise^  se     %n5
''7QV
 !H=F

 S#Jg.
fc*
 
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  z~Parsed string "200622-12-31" gives an invalid tzoffset, which must be between -timedelta\(hours=24\) and timedelta\(hours=24\)rc   ro  ru   r8  rf   rg   rh   r*   rt  rs  r   r  s      r1    test_to_datetime_malformed_raise/TestToDatetime.test_to_datetime_malformed_raisej  sv    $n5
K 	 ]]
 ++#; "	
 
 	
 
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:30ra   )r   r   r   r*   r+   )r,   ts_strr/   r0   s       r1   &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/r4   c                     SS[         /nSn[        R                  " [        US9   [	        U5        S S S 5        g ! , (       d  f       g = f)Nr  2015-11-18 16:30:00+06:30r   rc   )r   rf   rg   rh   r   r  s      r1   4test_iso_8601_strings_with_different_offsets_removedCTestToDatetime.test_iso_8601_strings_with_different_offsets_removed  s7    13NPST
F]]:S1
# 211s	   :
A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@  
   r   r   )r   r   r   r   r*   r+   )r,   r  r/   r0   s       r1   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/r4   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n[
        R                  " [        US	9   [        T5        S S S 5        g ! , (       d  f       g = f)
Nre   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r1  r  ).0rI  rX   r*  s     r1   	<genexpr>ZTestToDatetime.test_mixed_offsets_with_native_datetime_utc_false_raises.<locals>.<genexpr>  s      ?.>3q6T!W$.>s   r   rc   )	r   r   allrangerr  rf   rg   rh   r   )r,   r   rX   r*  s     @@r1   8test_mixed_offsets_with_native_datetime_utc_false_raisesGTestToDatetime.test_mixed_offsets_with_native_datetime_utc_false_raises  sx     l#++
 Tl?eCI.>?????F]]:S1 211s   *A??
Bc                     [        S/S-  5      n[        [        SSSS[        [	        SS95      S	9/S-  5      n[
        R                  " X5        g )
Nr  ra   r  r   r   r      r   r   )r   r   r   r   r   r*   r+   r   s      r1   #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/r4   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   )r,   r  r0   r/   s       r1   test_timestamp_utc_true&TestToDatetime.test_timestamp_utc_true  s     RT*!!!r4   dt_str)00010101130001013000010199990101c                     [        USS9n[        R                  " US5      n[        U5      nX$:X  d   eUR                  UR                  :X  d   eg )NrR   r   )r   r   r   r   r  )r,   r  r9  dtobjr0   s        r1   *test_to_datetime_with_format_out_of_bounds9TestToDatetime.test_to_datetime_with_format_out_of_bounds  sL     &2!!&(3U#xx8==(((r4   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	   r(   r   r   r   r  )r,   r.   r/   s      r1   test_to_datetime_utc#TestToDatetime.test_to_datetime_utc  s=    hh456fESd+yyHLL(((r4   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   )FixedOffseti\z-07:00r   r   r   ra   r   )-pandas.tests.indexes.datetimes.test_timezonesr  r   r   r   )r,   r  	fixed_offr   r/   s        r1   test_to_datetime_fixed_offset,TestToDatetime.test_to_datetime_fixed_offset  sb    Mh/	 T1a	2T1a	2T1a	2

 U#yyI%%%r4   r   z2020-10-26 00:00:00+06:00z2020-10-26 00:00:00+01:00r@  zAustralia/Melbournec                     Sn[         R                  " [        US9   [        USS9  S S S 5        g ! , (       d  f       g = f)Nr   rc   Fr  r   )r,   r   r   s      r1   5test_to_datetime_mixed_offsets_with_utc_false_removedDTestToDatetime.test_to_datetime_mixed_offsets_with_utc_false_removed  s.     G]]:S1%( 211s   0
>r  )gr  r  r  r  r.  r4  rf   r  filterwarningsr:  rD  rJ  r  rQ  r  r   r)  r   re  ri  r   rn  rt  rx  r}  r   r  r  r  r  r   skip_if_windowsr  r  r  skipifr   r  r  r  r  r&   r  r  r  r  r  r  r
  r  r  r#  r   listr'   r   r/  r3  r6  r<  rA  rJ  rN  rT  boolr   rW  r[  rh  rk  rv  tupler   r}  r  r  r  re   r   r  r   r   r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  
astimezonezoneinfoZoneInfor  r"  r  r4   r1   r$  r$  "  s#   1&( [[ ?@( 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  
 [[	:;;	;  [[LL%8[I8[I
 & LL%8[I8[I
 *	
./. [[LL%U/ " LL%U/ &	
*0+*0 [[	 56!#34  
 [[LL,.IJ?	
 [[	:;;	$;.( [[XdBAq%ABXdAq!Q%?@XdAq!Q%?@*htRQ&BC*htRQ&BCXdBAq%AB*htRQ&BC	
44 [[
	
++
 [[[s	
vn [[X':;> <ovp> [[TD,#78 9 [[UT5M2[[TD,#784 9 3 4*// [[%EF) G )  [[%EF[[T$6
#CD+ E G +2 [[UUG$45 6 [[B [[%EF[[	
 [[	
= G&= [[r}}\*BMM,,GH== [[&&	
00 [[r}}\*BMM,,GH [[X':;	 <		F [[Vc3Z00 100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'':;H <H [[WsJ&78[[Xj'9:> ; 9>$ [[W'<&=>[[Xj'9:+ ; ?+$ [[	se
|/EG [[X'=>C ?C> [[UT4L1[[X(94'@A[[]T5"((E5,QR0 S B 200 [[UT4L1[[X(94'@A1 B 21" [[0 rvv#*:!::*Q./ y.66s;<&++,i-55c:;sfGW>WW	 &++,!9\#:;< *Q./\*Il,CDE	
0?10? [[C52:+8<C52:+8<D6B;D6B;B4"9B4"9BEE7R< BEE7R< BFF8b=!BFF8b=!	
11 [[	

-
-	5 [[	')CD [[T1a q!MM,'	
	0		0&
+&0$0&0 [[|$i&GH,<8,7	
	"	"
 [[X'WX) Y))& [[(*EF()L\*RS+q!R(33%%&;<		
))r4   r$  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\R
                  R                  SSS/5      S 5       r\R
                  R                  SSS/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\R
                  R                  S\\/5      S# 5       r\R
                  R                  S$\\R2                  /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S- rS.r g)/TestToDatetimeUniti  r  YMitem   c                 .   [        X2S9nSn[        U/US9n[        U/X!S9n[        R                  " X5        [        [
        R                  " U/[        S9X!S9n[        R                  " X5        [        [
        R                  " U/5      X!S9n[        R                  " X5        [        [
        R                  " U[
        R                  /5      X!S9nUR                  5       S   (       d   e[        R                  " US S UR                  S5      5        g )Nr  ry   r#   r  rB   r   )r   r   r   r*   r+   r&   r'   r(   re   r   r  )	r,   rB   r  r  rE  r  r$   r0   r/   s	            r1   'test_to_datetime_month_or_year_unit_int:TestToDatetimeUnit.test_to_datetime_month_or_year_unit_int  s     t' "U3dV$<
f/RXXtfF;$T
f/RXXtf-DF
f/ RXXtRVVn5DN{{}Q
fRaj(//'*BCr4   c                    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        Sn[         R                  " [        US9   [        S/USS9  S S S 5        [        S/US	S9n[        [        /S
S9n[        R                  " XE5        [        S/US	S9n[        [        /5      n[        R                  " XE5        [        S/US9n[        S/US9R                  S5      n[        R                  " XE5        g ! , (       d  f       GN = f! , (       d  f       N= f! , (       d  f       N= f)Nz(Conversion of non-round float with unit=z is ambiguousrc         ?ru   r  rw   z/Given date string \"1.5\" not likely a datetimez1.5r~   M8[ns]r#         ?r  r   r  )rf   rg   rh   r   r&   r'   r   r   r*   r+   r)  )r,   rB   r  r   r9  r0   s         r1   3test_to_datetime_month_or_year_unit_non_round_floatFTestToDatetimeUnit.test_to_datetime_month_or_year_unit_non_round_float
  s/   
 9mL]]:S1D9 2]]:S1#d7C 2 A]]:S1d7; 2 3%d8<#h/
c, 5'X>u%
c, 3%d+s.66s;
c,/ 2111 21s#   E!EE)
E
E&)
E7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 unitrc   r   r  rR   )r  rA   rB   r   rS  s      r1   	test_unitTestToDatetimeUnit.test_unit)  s3     4]]:S1#heD 211rp  c                 "   SSS[         [        [        R                  SS/n[	        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  r~   r  rw   rB   )r   
1970-01-02r  r   r   r   r   r   ry   r#   z8cannot convert input 11111111111111111 with the unit 'D'rc   ru   r   r   r&   re   r   r   r*   r+   rf   rg   r   r,   rB   rE   r/   r0   r   s         r1   test_unit_array_mixed_nans-TestToDatetimeUnit.test_unit_array_mixed_nans0  sz    #QT3rJV#heL R
 	f/H]].c:SF ;::s   *B  
Bc                    S[         [        [        R                  S/n[	        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   r~   r  rw   r  rB   )r   r   r   r   r   ry   r#   z@cannot convert input 1420043460000000000000000 with the unit 's'rc   ru   r  r	  s         r1   $test_unit_array_mixed_nans_large_int7TestToDatetimeUnit.test_unit_array_mixed_nans_large_int>  so    +T3FVH3eL !DGT
f/P]].c:wSF ;::s   'A==
Bc                     Sn[         R                  " [        US9   [        SSSUS9  S S S 5        g ! , (       d  f       g = f)Nz4Unknown datetime string format, unable to parse: foorc   r  ru   r  r  r   rS  s      r1   8test_to_datetime_invalid_str_not_out_of_bounds_valuerrorKTestToDatetimeUnit.test_to_datetime_invalid_str_not_out_of_bounds_valuerrorI  s2     E]]:S1gCuE 211	   2
A errorru   r~   c                 l    [        S5      n[        SSX!S9nXC:X  d   e[        U[         5      (       d   eg )Nz1970-05-09 14:25:11iǊ r  r  )r   r   r  )r,   rB   r  r0   r/   s        r1   test_unit_consistency(TestToDatetimeUnit.test_unit_consistencyP  s<     23XCK!!!&),,,,r4   rw   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   r*   r+   )r,   rB   rw   r$   r0   r.   r/   s          r1   test_unit_with_numeric)TestToDatetimeUnit.test_unit_with_numericX  sS    
 !"$9:(
 hh[1299%@Su=
f/r4   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#   ro  rc   r~   r  )r   r*   rt  r   r+   )r,   rB   r   r.   warningr0   r/   s          r1   test_unit_with_numeric_coerce0TestToDatetimeUnit.test_unit_with_numeric_coerced  sO    $ !H5''7OP XUCF Q
fh/ QPs   A
Ar.   rQ  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  ru   )r   r   r   r*   r+   r   )r,   rB   r.   rY   r0   r/   s         r1   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  rJ   )r,   rB   r   r/   r0   alts         r1   test_unit_rounding%TestToDatetimeUnit.test_unit_rounding  sD     #UE:<=!!!C(}}r4   c           
      B   Sn[        [        S5       Vs/ s H  o2U-   PM	     sn5      R                  U5      n[        USS9nSn[        [        S5       Vs/ s H  n[	        S5      [        US9-   PM     snSU S3S	9n[        R                  " XW5        g s  snf s  snf 
NQr  r  r  2013-06-09 02:42:28secondsM8[r  r#   )r   r  r  r   r   r   r*   rV   )r,   r$   epochtrX   r/   r  r0   s           r1   test_to_datetime_unit(TestToDatetimeUnit.test_to_datetime_unit  s    r3Aai34;;EBSs+ r"A /09Q3GG" vQ-
 	v0 4s   BBnullc           
      <   Sn[        [        S5       Vs/ s H  o2U-   PM	     snU/-   5      n[        USS9nSn[        [        S5       Vs/ s H  n[        S5      [	        US9-   PM     sn[
        /-   SU S3S	9n[        R                  " XW5        g s  snf s  snf r,  )r   r  r   r   r   r   r*   rV   )r,   r6  r2  r3  rX   r/   r  r0   s           r1    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vQ-

 	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                  R                  S5      n[        R                  " XE5        g s  snf s  snf )Nr-  r   ra   g      ?r  r  r.  r/  r  r#   ms)r   r&   aranger   r  r]   r   r   r   r   r   roundr*   rV   )r,   r2  r3  rX   r/   r0   s         r1   (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	
 
 &
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   ra   r   r  r  r  
1970-01-03r   ry   r#   )r   r   r&   re   r   r   r*   r+   r   s      r1   test_to_datetime_unit_na_values2TestToDatetimeUnit.test_to_datetime_unit_na_values  sW    aE37cB |$i&=>%1L
 	f/r4   bad_valr  l   q$8 c                     US:X  a  SU 3nOSn[         R                  " [        US9   [        SSU/SS9  S S S 5        g ! , (       d  f       g = f)	Nr  z1Unknown datetime string format, unable to parse: z6cannot convert input 111111111111111 with the unit 'D'rc   r   ra   r  r  r   )r,   rD  r   s      r1   test_to_datetime_unit_invalid0TestToDatetimeUnit.test_to_datetime_unit_invalid  sE    eEgYOCJC]]:S1Awc2 211s	   ?
Ac                     [        [        S5      [        S5      /S/S-  -   SS9n[        SSU/SS	S
9n[        R                  " X25        g )Nr  rA  r   r   ry   r#   ra   r  r~   r  rH  )r,   rD  r0   r/   s       r1   test_to_timestamp_unit_coerce0TestToDatetimeUnit.test_to_timestamp_unit_coerce  sR     !|$i&=>%1L
 aG_3xH
f/r4   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#   )ru   r~   r  r  g|=)rtolrc   ru   )r   r]   r  r&   r  r   r*   assert_almost_equalr  rf   rg   r   )
r,   r   oneday_in_nstsmax_in_daysshould_succeedr0   
error_moder+  should_fail1should_fail2s
             r1   (test_float_to_datetime_raise_near_bounds;TestToDatetimeUnit.test_float_to_datetime_raise_near_bounds  s.   2),%~'=>e
 #199"((C-J!.s:NG ""rxx(//

;

+	 . q-%"78Fq=.5"89G]].c:3w? ;]].c:3w? ;: ;:::s   E1E
E
E%r  )!r  r  r  r  rf   r  r  r]   r  r   r  r
  r  r  r  r  rs  r"  r   r%  r)  intr4  r   r&   re   r8  r>  rB  rF  rI  rT  r"  r  r4   r1   r  r    sW   [[Vc3Z0[[Vc5:%67D 8 1D( [[Vc3Z0- 1-<EG	GF [[Ww&9:- ;- [[X':;[[Wy'&:;0 < <0 [[ F1 M8	
00 [[z"K=+y'<=	
00"	 [[WsEl31 41 [[VdBFF^41 511"0 [[Y(@A3 B3 [[Y(@A0 B0@r4   r  c                   D   \ 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S r\R                  R                  SS/SS// SQSS// SQ/5      S 5       rS rS rS rS  rS! rS"rg#)$TestToDatetimeDataFramei  c                 P    [        SS/SS/SS/SS/S	S
/SS/SS/SS/SS/S.	5      $ )Nr    ra   r   r   rQ   r     :   ;   r  r  r   	r  r  r  r  r  secondr;  rW  r&  )r   r3  s    r1   dfTestToDatetimeDataFrame.df  sS    tQ1vAr(r(!f!f!f

 	
r4   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[        SS	/5      Ul        [        R                  " X45        g )
Nr  r  r  r  r  r  r   20150204 00:00:00z20160305 00:0:00r   r   )r   r   r   r*   rV   to_dictr   indexr,   r`  rB   r/   r0   s        r1   test_dataframe&TestToDatetimeDataFrame.test_dataframe  s    Z"W+biHPU
 *+Y7I-JK
 	v0 R 89AAC5Q1v
v0r4   c                     U/ SQ   R                  5       nSUS'   [        X2S9n[        [        S5      [        S5      /[	        SS/5      S	9n[
        R                  " XE5        g )
Nrc  ra   r  r   rd  z20160205 00:0:00r   r   rf  )re  r   r   r   r   r*   rV   )r,   r`  rB   df2r/   	expected2s         r1   &test_dataframe_dict_with_constructable>TestToDatetimeDataFrame.test_dataframe_dict_with_constructable#  sb    )*224GS.*+Y7I-JKA-
	 	v1r4   r  yearsmonthsdaysr?  r   r0  )r  r  r  r  r  r_  r  r  r  r  r  r_  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   r*   rV   )r,   r`  rB   r  r/   r0   s         r1   *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0r4   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  r_  r;  rW  r&  r^  rt  r   20150204 06:58:10.00100200320160305 07:59:11.001002003)r   rw  r   r   r*   rV   )r,   r`  rB   dr/   r0   s         r1   test_dataframe_field_aliases4TestToDatetimeDataFrame.test_dataframe_field_aliasesL  sn    

 RYYqY1?7878
 	v0r4   c                     [        UR                  [        5      US9n[        [	        S5      [	        S5      /5      n[
        R                  " X45        g Nr   r{  r|  )r   r  rU   r   r   r*   rV   rg  s        r1   test_dataframe_str_dtype0TestToDatetimeDataFrame.test_dataframe_str_dtypeb  sG    RYYs^597878
 	v0r4   c                     [        UR                  [        R                  5      US9n[	        [        S5      [        S5      /5      n[        R                  " X45        g r  )r   r  r&   float32r   r   r*   rV   rg  s        r1   test_dataframe_float32_dtype4TestToDatetimeDataFrame.test_dataframe_float32_dtypem  sN     RYYrzz2%@7878
 	v0r4   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  rZ  ra   r  r   rQ   rc  zO^cannot assemble the datetimes: time data ".+" doesn\'t match format "%Y%m%d"\.rc   r   r~   r  rd  )
r   rf   rg   rh   r   r   r   r   r*   rV   )r,   rB   rl  r   r/   r0   s         r1   test_dataframe_coerce-TestToDatetimeDataFrame.test_dataframe_coercey  s    $BAOP' 	 ]]:S1) 2 S?9%893?@
v0 21s   
A??
Bc                     SnUR                  5       nSUS'   [        R                  " [        US9   [	        XBS9  S S S 5        g ! , (       d  f       g = f)Nz?extra keys have been passed to the datetime assemblage: \[foo\]r   r  rc   r   )copyrf   rg   rh   r   )r,   r`  rB   r   rl  s        r1    test_dataframe_extra_keys_raises8TestToDatetimeDataFrame.test_dataframe_extra_keys_raises  s=    PggiE
]]:S1) 211   
A
Acols)r  r  r_  )r  r  r_  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 missingrc   r   r   )r,   r`  rB   r  r   s        r1   "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  rZ  ra   r  r   rQ   rc  )r  r  r  rc   r   )r  r  r  r  )r  r  r  r  )r   ru  rf   rg   rh   r   )r,   rB   r   rl  s       r1   '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  rZ  ra   r   r   rQ   rc  int16r   rd  20160305 00:00:00)r   r   r  r   r   r*   rV   r,   rB   r`  r/   r0   s        r1   test_dataframe_int16,TestToDatetimeDataFrame.test_dataframe_int16  sd    t1vq!fMN RYYw/u=*+Y7J-KL
 	v0r4   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  rZ  ra   r   r   rQ   rc  r  int8r  r   rd  r  )r   r  r   r   r   r*   rV   r  s        r1   test_dataframe_mixed,TestToDatetimeDataFrame.test_dataframe_mixed  s    t1vq!fMNk((07uI$$V,5	R-*+Y7J-KL
 	v0r4   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   rc  z\^cannot assemble the datetimes: unconverted data remains when parsing with format ".*": "1".rc   r   )r   rf   rg   rh   r   )r,   rB   r`  r   s       r1   test_dataframe_float,TestToDatetimeDataFrame.test_dataframe_float  sM    tQxAOP& 	 ]]:S1( 211r  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  rZ  ra   r   r   rQ   rc  Tr  z
2015-02-04z
2016-03-05r  r#   r   )	r   r   r   r&   r'   r   tz_localizer*   rV   )r,   r`  r/   r0   s       r1   test_dataframe_utc_true/TestToDatetimeDataFrame.test_dataframe_utc_true  sj    t1vq!fMNRT*HHlL19IJ

"[[ 	 	v0r4   r  N)r  r  r  r  rf   fixturer`  rh  rn  r  r  rx  r~  r  r  r  r  r  r  r  r  r  r  r"  r  r4   r1   rX  rX    s    ^^
 
1	2 [[  !##  ""	
*1+*11,	1
11* [[HW'e%	
	/	/*	1	1)1r4   rX  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#S$/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#S0 r$S1 r%S2 r&S3 r'S4 r(S5 r)S6 r*\R                  R                  S7/ S8Q5      S9 5       r+S: r,S; r-S< r.\R                  R                  S=\/\0Rb                  /5      S> 5       r2S?r3g@)ATestToDatetimeMisci  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#   z'^Out of bounds nanosecond timestamp: .*rc   )r&   r'   r(   rf   rg   r   r   )r,   r.   r   s      r1   %test_to_datetime_barely_out_of_bounds8TestToDatetimeMisc.test_to_datetime_barely_out_of_bounds  s@     hh78G7]].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   rJ   )r,   rB   rK   exp_strr/   r   s         r1   test_to_datetime_iso8601+TestToDatetimeMisc.test_to_datetime_iso8601  s.     cU%0 ayCr4   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 \"\"rc   r   r   )r,   r  rA   r   s       r1   test_to_datetime_iso8601_fails1TestToDatetimeMisc.test_to_datetime_iso8601_fails  sC    " ]]"5')HPRS
 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 ".*". rc   r   r  )r,   r  rA   r   s       r1   $test_to_datetime_iso8601_exact_fails7TestToDatetimeMisc.test_to_datetime_iso8601_exact_fails
	  sb     hhQ"#1&>>OqQ
 ]]
 -	
 
 
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 )N  r   Fr   r   r   r,   r  rA   r0   r/   s        r1   "test_to_datetime_iso8601_non_exact5TestToDatetimeMisc.test_to_datetime_iso8601_non_exact$	  s*     T1a(U?!!!r4   ))2020-01z%Y/%m)rP  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  rc   r   r   )r,   r  rA   s      r1   "test_to_datetime_iso8601_separator5TestToDatetimeMisc.test_to_datetime_iso8601_separator3	  sA     ]]"5')I&QST
 -	
 
 
s	   
4
A))r  r  )rP  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        r1   test_to_datetime_iso8601_valid1TestToDatetimeMisc.test_to_datetime_iso8601_validH	  (    $ T1a(U2!!!r4   ))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        r1   #test_to_datetime_iso8601_non_padded6TestToDatetimeMisc.test_to_datetime_iso8601_non_padded^	  r  r4   ))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   r   r  r   r  s        r1   ,test_to_datetime_iso8601_with_timezone_valid?TestToDatetimeMisc.test_to_datetime_iso8601_with_timezone_validt	  s.     T1a=U2!!!r4   c                 @    [        SUS9n[        SSS5      nX#:X  d   eg )N2001r   r   r   r  )r,   rB   rsxps       r1   test_to_datetime_default+TestToDatetimeMisc.test_to_datetime_default	  s%    u-dAq!xxr4   z1fails to enforce dayfirst=True, which would raiser  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 specifiedrc   zProvide formatz
01-13-2012TdayfirstrB   r  rS  s      r1   "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 )Nr=   r  r  r   r   )r   r   r   )r,   rB   rX   r/   s       r1   %test_to_datetime_on_datetime64_series8TestToDatetimeMisc.test_to_datetime_on_datetime64_series	  s3    Z
B78S.ayCF"""r4   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        g ! , (       d  f       NX= f)N)z
10/18/2006z
10/18/2008 z1^time data " " doesn\'t match format "%m/%d/%Y". r	  rc   ru   r  r~   i  r  r@  r  )
r   r  rf   rg   rh   r   r   r   r*   rV   )r,   rB   rX   r   result_coerceexpected_coerces         r1   %test_to_datetime_with_space_in_series8TestToDatetimeMisc.test_to_datetime_with_space_in_series	  s    67@_DUUVW 	 ]]:S1G59 2#CF (4R"8(4R:PRU!VW
}>	 21s   B
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   ra   r   rk  %b %yr@   r   r   rT   r*   rV   )r,   rB   r   r0   r/   s        r1   test_to_datetime_with_apply.TestToDatetimeMisc.test_to_datetime_with_apply	  s?    
 2)Dr'?+gUC
v0r4   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      r1   test_to_datetime_timezone_name1TestToDatetimeMisc.test_to_datetime_timezone_name	  s5    5>STT1a(44U;!!!r4   rw   ru   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  rk  r  rv   c                    > [        U SSTS9$ )Nr  r~   rv   r   )rY   rB   s    r1   r^  OTestToDatetimeMisc.test_to_datetime_with_apply_with_empty_str.<locals>.<lambda>	  s    k!GHERr4   r  )r,   rB   rw   r   r0   r/   s    `    r1   *test_to_datetime_with_apply_with_empty_str=TestToDatetimeMisc.test_to_datetime_with_apply_with_empty_str	  sC     ,I>r'&NR
 	v0r4   c                 .    [        SUS9nU[        L d   eg Nr   r   r2  r,   rB   r/   s      r1   test_to_datetime_empty_stt-TestToDatetimeMisc.test_to_datetime_empty_stt	  s    Ru-}}r4   c                 \    [        SS/US9n[        U5      R                  5       (       d   eg r
  )r   r   r  r  s      r1   test_to_datetime_empty_str_list2TestToDatetimeMisc.test_to_datetime_empty_str_list	  s+    b"XU3F|!!!!r4   c                 <    [        S5      n[        SUS9nX#:X  d   eg )Nr   r   r  )r,   rB   r/   r0   s       r1   test_to_datetime_zero(TestToDatetimeMisc.test_to_datetime_zero	  s#    1q.!!!r4   c                 B    [        S/US9S   n[        SUS9nX2:X  d   eg )Nr  r   r   r   )r,   rB   r0   r/   s       r1   test_to_datetime_strings+TestToDatetimeMisc.test_to_datetime_strings	  s-    xu5a8V51!!!r4   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   r*   rM  )r,   rB   r'   r  r0   date_strr/   s          r1   "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r/   r  c                 ,    [        SSS5      nX:X  d   eg )Nr  r   )r   r   s      r1   'test_to_datetime_strings_vs_constructor:TestToDatetimeMisc.test_to_datetime_strings_vs_constructor	  s    T1a(!!!r4   c                     Sn[         R                  " [        US9   [        SS/SUS9  S S S 5        g ! , (       d  f       g = f)Nz-^Given date string "1" not likely a datetime$rc   r   1ru   r  r   rS  s      r1   $test_to_datetime_unprocessable_input7TestToDatetimeMisc.test_to_datetime_unprocessable_input	  s3     >]]:S1C> 211rp  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& r`   Or   )r&   r  viewr  r   r   )r,   r2  as_objrf  r   s        r1   'test_to_datetime_other_datetime64_units:TestToDatetimeMisc.test_to_datetime_other_datetime64_units	  se    *+00:s#vh'Qx6==----&!r4   c                     [        SSSS9n[        UR                  5      n[        UR                  5      n[        U5      n[
        R                  " X5        g )Nr=   r  r&  )r  r  )r   r   rE   r  asi8r*   r+   )r,   rngintsr/   s       r1   !test_to_datetime_list_of_integers4TestToDatetimeMisc.test_to_datetime_list_of_integers	  sC    Rd;CJJ'CHH~t$
c*r4   c                     Sn[         R                  " [        US9   [        S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 overflowrc   z1/1/1700Br{  r&  )startr  r  r  )rf   rg   r   r   r,   r   s     r1   r:  ,TestToDatetimeMisc.test_to_datetime_overflow 
  s3     O]]/s;Zc6M <;;r  c                     [        [        R                  /S-  S/-   [        R                  S9n[	        USSS9n[        [
        /S-  [        S5      /-   SS9n[        R                  " X#5        g )	N  g  @昃Ar#   r  r~   r  z2024-04-04 08:23:53datetime64[s])	r   r&   re   r  r   r   r   r*   rV   )r,   rX   r/   r0   s       r1   5test_to_datetime_float_with_nans_floating_point_errorHTestToDatetimeMisc.test_to_datetime_float_with_nans_floating_point_error
  sd    bffX_~5RZZHSs8<EDLI&;<==_
 	v0r4   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 formatrc   ru   r  )r&   r'   r(   rf   rg   rh   r   )r,   rB   invalids      r1   test_string_invalid_operation0TestToDatetimeMisc.test_string_invalid_operation
  s@    ((=>fM ]]:-MNu= ONNs   A		
Ac                    [         R                  " SS[         R                  S/[        S9n[         R                  " SSS9n[        U5       H,  u  pE[        U5      (       a
  [        X4'   M  [        U5      X4'   M.     [        R                  " U5      S   n[        R                  " Xc5        [        X!S9n[        U[        5      (       d   e[        R                   " XgR"                  5        g )	Nr=   r>   z1/4/2000r#   r   r`   r   r   )r&   r'   re   r(   empty	enumerater   r   r	   r
   array_to_datetimer*   rM  r   r  r   assert_numpy_array_equalrE   )r,   rB   stringsr0   rI  r   r/   r,  s           r1   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;r4   c                 R   [         R                  " S[         R                  /[        S9nSn[        R
                  " [        US9   [        USUS9  S S S 5        [        R
                  " [        US9   [        USUS9  S S S 5        g ! , (       d  f       N<= f! , (       d  f       g = f)Nz
1/100/2000r#   r;  rc   ru   r  )r&   r'   re   r(   rf   rg   rh   r   )r,   rB   	malformedr   s       r1   'test_string_na_nat_conversion_malformed:TestToDatetimeMisc.test_string_na_nat_conversion_malformed*
  sw    HHlBFF36B	 0]]:S1	'? 2 ]]:S1	'? 21 21 21s   B2B
B
B&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)r^  rm  cr}  er=   r?   z1/5/2000r  rf  r  r   rQ   r`   r#   rk  F)check_names)r   r&   re   r   r@  r  r|  r   r   r*   rV   r  )
r,   rB   idxseriesdseriesr/   dresultr0   rI  rY   s
             r1   'test_string_na_nat_conversion_with_name:TestToDatetimeMisc.test_string_na_nat_conversion_with_name5
  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$$$r4   r  )hmr  r;  rW  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 )Nr1  r  )z2000-01-01T00:00z2000-01-02T00:00r   r   )rV  rW  r  )r&   r$   r   rE   r  r   r*   r+   )r,   rB   r  r$   baserE   	exp_dtyper0   s           r1   $test_dti_constructor_numpy_timeunits7TestToDatetimeMisc.test_dti_constructor_numpy_timeunitsW
  s     3tfA'JRWX##E*:DHHs4&]+	 Y!78~~***
mF3X>
k&>Ir4   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  ra   r  r  r   Tr  r  )	r   r   r&   r'   r   r   r   r*   r+   )
r,   rB   r.   r0   idx1idx2idx3idx4idx5idx6s
             r1   test_dayfirst TestToDatetimeMisc.test_dayfirstl
  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-r4   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/2011rx   z
2011-03-10r  r   Tr^  rc   F)r   r   r*   r+   rt  rs  )r,   warning_msgr.   r0   res1res2s         r1   "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)Nrh  z
03/30/2011z:^time data "03/30/2011" doesn\'t match format "%d/%m/%Y". r	  rc   Tr^  )rf   rg   rh   r  r   )r,   r.   s     r1   $test_dayfirst_warnings_invalid_input7TestToDatetimeMisc.test_dayfirst_warnings_invalid_input
  sK     \*]]  /03
 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   rw  r  r   r*   rC   )r,   rq  r  r0   objr/   s         r1   test_to_datetime_dta_tz*TestToDatetimeMisc.test_to_datetime_dta_tz
  sS     q188???5)Cj?Sd+
)r4   r  N)4r  r  r  r  r  rf   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r!  r  r  r  r  r  r  r  r  r   r   r  r!  r'  r-  r:  r7  r=  rE  rI  rT  r[  re  rl  ro  r   r   _from_sequencert  r"  r  r4   r1   r  r    s    [["$9:&	
  
 [[		
 [[WtUm4; 5; [[	
	.	.  [[	
"" [[		
.. [[	
 "! " [[	
 "! " [[	
""
 [[QR	F S	F#
? 1 1" [[X':;
1 < 
1
"""1 [[X	&(9;v;N'OP" Q"?	+N1><&	@ %D [[)J	J".&.,," [[W}m6R6R&ST	* U	*r4   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.000000rz  rz  rz  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'   r(   tools _guess_datetime_format_for_array)r,   ry  expected_format
test_arrays       r1   $test_guess_datetime_format_for_array<TestGuessDatetimeFormat.test_guess_datetime_format_for_array
  s2    " 1XXiv6
55jA_TTTr4   c                     [         R                  " [        R                  " [        R                  [        R                  [        R                  /SS95      nUb   eg )Nr$  r#   )r}  r~  r&   r'   re   )r,   format_for_string_of_nanss     r1   -test_guess_datetime_format_for_array_all_nansETestGuessDatetimeFormat.test_guess_datetime_format_for_array_all_nans
  sB    $)$J$JHHbffbffbff-S9%
! )000r4   r  N)r  r  r  r  rf   r  r  r&   re   r  r   r!  r  r"  r  r4   r1   rx  rx  
  s    [[
 VVRVV9:-.01)?;0123	
 U! U
 1 1r4   rx  c                   L   \ 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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 )Nr6   2   rV  r  r  c                 &   > U R                  T5      $ r1  )strftime)rY   r  s    r1   r^  dTestToDatetimeInferFormat.test_to_datetime_infer_datetime_format_consistent_format.<locals>.<lambda>
  s    ajj.Er4   r@   r   )r   r   rT   r   r*   rV   )r,   rB   r  rX   s_as_dt_stringswith_formatwithout_formats     `    r1   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 	{;r4   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:00zL^time data "01-02-2011 00:00:00" doesn\'t match format "%m/%d/%Y %H:%M:%S". r	  rc   r   )r   r&   r'   r  rf   rg   rh   r   )r,   rB   r   rX   r   s        r1   $test_to_datetime_inconsistent_format>TestToDatetimeInferFormat.test_to_datetime_inconsistent_format
  sT    TRXXd^$%%4$5Q8 	 ]]: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   r*   rV   )r,   rB   r   rX   r/   r0   s         r1   "test_to_datetime_consistent_format<TestToDatetimeInferFormat.test_to_datetime_consistent_format
  sC    <RXXd^$S.6>N
 	v0r4   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'   re   r(   r   r   r*   rV   rz   s        r1   !test_to_datetime_series_with_nans;TestToDatetimeInferFormat.test_to_datetime_series_with_nans
  se    HH&0ErvvN
 S.3c2:J
 	v0r4   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        r1   'test_to_datetime_series_start_with_nansATestToDatetimeInferFormat.test_to_datetime_series_start_with_nans  sp    HHFFFF))) 	
 S.#|\<@HX
 	v0r4   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  r*   rV   )r,   tz_namer  rX   r/   r   r0   s          r1   "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0r4   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   r   r  r   r*   rV   )r,   r  zero_tzrX   r/   r   r0   s          r1   "test_infer_datetime_format_zero_tz<TestToDatetimeInferFormat.test_infer_datetime_format_zero_tz#  sM     bl^$S!$^X\\9R/01
v0r4   rA   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-03r@   r@  )r,   rB   rA   rX   r0   r/   s         r1   %test_to_datetime_iso8601_noleading_0s?TestToDatetimeInferFormat.test_to_datetime_iso8601_noleading_0s4  sR     9:,',','
 Su=
v0r4   r  )r  r  r  r  rf   r  r  r  r  r  r  r  r  r  r  r"  r  r4   r1   r  r  
  s    [[S<<*111( [[51	1 [[	
11 [[Xj'9:1 ;1r4   r  c                   2   \ rS rSr\R
                  R                  SSS/SS/SS/SS//5      S 5       rS	 r\R
                  R                  S
SSS\	 S\
 S34SSS\	 S\
 S34SSS\
 S34SSS\
 S34SSS\	 S\
 S34SSS\	 S\
 S34/5      S 5       rSrg)TestDaysInMonthiC  r  
2015-02-29Nr   z
2015-02-32z
2015-04-31c           	      :    [        [        USX1S95      (       d   eg )Nr~   rw   rA   rB   )r   r   )r,   rB   rK   rA   s       r1   test_day_not_in_month_coerce,TestDaysInMonth.test_day_not_in_month_coerceF  s     KHVQRRRRr4   c                     [         (       a  SnOSn[        R                  " [        US9   [	        SSUS9  S S S 5        g ! , (       d  f       g = f)NzBday 29 must be in range 1..28 for month 2 in year 2015: 2015-02-29z)day is out of range for month: 2015-02-29rc   r  ru   r  )r   rf   rg   rh   r   rS  s      r1   test_day_not_in_month_raise+TestDaysInMonth.test_day_not_in_month_raiseR  s7    5VC=C]]:S1WEB 211s	   ?
Azarg, format, msg^z. r	  z
2015-29-02r   zD^unconverted data remains when parsing with format "%Y-%m-%d": "2". z
2015-32-02z9^time data "2015-32-02" doesn't match format "%Y-%d-%m". z
2015-31-04c                     [         R                  " [        US9   [        USX1S9  S S S 5        g ! , (       d  f       g = f)Nrc   ru   r  r   )r,   rB   rK   rA   r   s        r1   !test_day_not_in_month_raise_value1TestDaysInMonth.test_day_not_in_month_raise_valueZ  s+    N ]]:S1GFH 211s   /
=r  )r  r  r  r  rf   r  r  r  r  DAY_IS_OUT_OF_RANGEr  r  r"  r  r4   r1   r  r  C  sG    [[4 :&:&:&		
SSC [[ '(?*;1= '(?*;1= V"#1& L"#1& '(?*;1= '(?*;1=9!	
$JIK$JIr4   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SXSRSP\" S$SFS5      4/	5      SY 5       r\R
                  R                  SZS[\" SSSSS)5      /S\\" SSSS'S%5      //5      S] 5       r\R
                  R                  S^S_\" \" S`Sa95      Sb4Sc\" \" SdSa95      Se4/5      Sf 5       rSgrgh)iTestDatetimeParsingWrappersi  zdate_str, expectedr  i  r   2Q2005i  r   2Q052005Q105Q12011Q3r[  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=  rQ   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     $   r  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  pVSS0R                  US5      n[        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XX4 H
  nX:X  a  M
   e   XXU4 H=  n[        [        U5      /5      R                  U5      n[        R                  " X5        M?     U(       d(  [        U5      nUU:X  d   e[        USS	US
9nUU:X  d   eg g )NT)	yearfirst
nanosecondr&  rW  r#   )r  rB   Sr   )r  r  r  )r   parse_datetime_string_with_resogetr   r&   r'   r(   r   r   r   r   r)  r*   r+   r   )r,   r  r0   rB   r  r+  reso_attrnameresor,  r-  rI  result6result8result9r9  r   result5result7s                     r1   test_parsers(TestDatetimeParsingWrappers.test_parsers  s=   p 	!(!H!H"

 $

#mT
" 	 h<xjI>HHhZv.)
  
i@xj 1YGz 2iH%C?"? &g@C8!4 56>>tDC!!#+ A
 )Gh&&& Q)TGh&&&	 r4   c                 n    [        [        [        /SS9n[        X#/US9n[        R                  " XT5        g )Nr6  r#   r   )r   r   r   r*   r+   )r,   rB   unique_nulls_fixtureunique_nulls_fixture2r0   r/   s         r1   test_na_values_with_cache5TestDatetimeParsingWrappers.test_na_values_with_cache  s3     #s?;2JRWX
f/r4   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   )r,   r+  _r,  r-  rI  s         r1   test_parsers_nat,TestDatetimeParsingWrappers.test_parsers_nat  si    <<UC
e$E"(+#~~#~~#~~#~~r4   z'date_str, dayfirst, yearfirst, expectedz10-11-12Fr  Ti  z20/12/21i  r     20201012c                     [        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  rB   r   )r	   r   r  r   r   r   )r,   rB   r  r  r  r0   dateutil_resultr+  r  r,  r-  rI  s               r1   test_parsers_dayfirst_yearfirst;TestDatetimeParsingWrappers.test_parsers_dayfirst_yearfirst  s    z  yQ***<<9


 	)G&&&9
  
XSTUV"""""""""r4   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   )
r,   r  exp_defexp_nowr+  r  r,  r-  rI  r  s
             r1   test_parsers_timestring3TestDatetimeParsingWrappers.test_parsers_timestringE  s     /<<XF
h'xj)H%
+A. !!!!!!!!!!!!!!!r4   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  rA  repr)r,   rB   	dt_stringr   dt_string_reprrY  dt_times          r1   .test_parsers_timezone_minute_offsets_roundtripJTestDatetimeParsingWrappers.test_parsers_timezone_minute_offsets_roundtrip[  sR    & 0>&11"5i5g...r4   r  N)r  r  r  r  rf   r  r  r   r  r  r  r  r  r   r   r  r"  r  r4   r1   r  r    s}   [[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"'H0	 [[1xb"'=>uhtR&<=htR&<=tXdB%;<xb"'=>uhtR&<=htR&<=tXdB%;<uhtR&<=	
B#B#H [[
8Aq!R,	-Aq!Q8O/PQ"	"$ [[' (3/0G (3/0G	
//r4   r  )r  r  r;  rW  r&  )paramsc                     U R                   $ )z1Day and some time units.

* D
* s
* ms
* us
* ns
)r  )rE  s    r1   unitsr
  u  s     ==r4   c                  F    [        SSS9R                  5       R                  $ )Nr  r  r  )r   to_julian_daterE   r  r4   r1   julian_datesr    s    j"-<<>EEEr4   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  originz1970-01-01 00:00:02i ʚ;z2001-09-09 01:46:41rJ   )r,   r  r0   s      r1   test_origin_and_unitTestOrigin.test_origin_and_unit  sH    Q/23~~];23~~r4   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  r*   rV   )r,   r  r/   r0   s       r1   test_julianTestOrigin.test_julian  sM     Ls8LMy|'B'B'DD3O
 	v0r4   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   ra   r  unixr  z
1970-01-01r  rA  ry   r#   r:  r   s      r1   	test_unixTestOrigin.test_unix  sK    ICGH|$i&=y?VW
 	v0r4   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'rc   r   )r   r  rf   rg   rh   )r,   r/   r   s      r1   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'rc   r  r  r   )r,   r
  r  r   s       r1   test_invalid_unitTestOrigin.test_invalid_unit  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 specifiedrc   z
2005-01-01
1960-01-01r  r   )r,   r  r   s      r1   test_invalid_originTestOrigin.test_invalid_origin  s/     9]]:S1\E 211rY  epochs  r   r%  c           
      <   [        SSS5      n[        R                  " S[        R                  S9nUS:X  a  SOUn[	        U Vs/ s H  n[
        R                  " XaS9U-   PM     snSU S	3S9n[	        [        XAUS
95      n[        R                  " X5        g s  snf )Nr)  r   rQ   r#   r  r  r  r1  r  r  )
r   r&   r<  r  r   r   	Timedeltar   r*   rV   )	r,   r
  r(  
epoch_1960units_from_epochsr  rY   r0   r/   s	            r1   
test_epochTestOrigin.test_epoch  s     tQ*
IIarxx83,3E?PQ?P!R\\!(:5?PQz#

 $5&QR
v0 Rs   !Bzorigin, excr{  r2  z
13-24-1990c                     SR                  SU S3SU S3S/5      n[        R                  " X$S9   [        [	        [        S5      5      X1S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 overflowrc   rQ   r  )r  rf   rg   r   r  r  )r,   r  excr
  r   s        r1   test_invalid_originsTestOrigin.test_invalid_origins  s`     hh&!23&!DE>
 ]]3*U1XUB +**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-naiverc   r   r  r   r   r  )rf   rg   rh   r   r   r   r  r3  s    r1   test_invalid_origins_tzinfo&TestOrigin.test_invalid_origins_tzinfo  s9    ]]:-?@HT1a,UV A@@s   $A
Ac                     Sn[         R                  " [        US9   [        SS/5        S S S 5        g ! , (       d  f       g = f)Nz:Unknown datetime string format, unable to parse: yesterdayrc   r  	yesterdayr   r2  s     r1   test_incorrect_value_exception)TestOrigin.test_incorrect_value_exception  s.    J]]:S1+./ 211rp  zformat, warningN)r   N)r   Nc                 8   UcX  [        SUS9n[        U[        5      (       d   eUR                  S:X  d   eUR                  S:X  d   eUR
                  S:X  d   eg Sn[        R                  " [        US9   [        SUS9  S S S 5        g ! , (       d  f       g = f)Nz2417-10-10 00:00:00.00r   iq	  r  z3unconverted data remains when parsing with format.*rc   )	r   r  r   r  r  r  rf   rg   rh   )r,   rA   r!  r9  r   s        r1   .test_to_datetime_out_of_bounds_with_format_arg9TestOrigin.test_to_datetime_out_of_bounds_with_format_arg  s     >6vFCc9----88t###99?"?77b= =GCz54VD 655s   7B
Bzarg, origin, expected_str)( r  z2169-11-13 00:00:00)r>  
1870-01-012069-11-13 00:00:00)鼫 r?  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  r>  r?  r@  rA  rB  rJ   )r,   rK   r  expected_strr/   r0   s         r1   test_processing_order TestOrigin.test_processing_order  sr     Ss6:\*!!!YSF23!!!YSF23!!!r4   zoffset,utc,exp)r  T2019-01-01T00:00:00.000Z)r  NrG  )-01:00Tz2019-01-01T01:00:00.000Z)rH  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  rW  )r   r)  r*   r+   )r,   r  r  r   rK   r/   r0   s          r1   test_arg_tz_ns_unitTestOrigin.test_arg_tz_ns_unit  sC     (&0cU37u%--d3
f/r4   r  )r  r  r  r  r  r  r  r  r"  rf   r  r  r&  r   r   r&   r  r.  rh   r   r2  r5  r9  rs  r<  rE  rJ  r"  r  r4   r1   r  r    s   116G [[VdC[1F 2F [[dAq!T1a MM,'		

1
1 [[j)j!:&aA 34		
	C	CW
0 [[;''	
EE [[#6<<	
""  [[338=		
00r4   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   ra   r   r   rQ   r  r[  r  r  r   F)
r   r   r   r   r   rQ   r  r[  r  r  Tc                 N    [         R                  " U[        U5      SS9U:X  d   eg )Ngffffff?)check_countunique_share)r}  should_cacherr  )r,   listlike
do_cachings      r1   test_should_cache!TestShouldCache.test_should_cache.  s-     xS]QTU	
r4   z%unique_share,check_count, err_message)g      ?r  z5check_count must be in next bounds: \[0; len\(arg\)\])r  ra   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)NrQ   r  rc   )rf   rg   AssertionErrorr}  rQ  )r,   rP  rO  err_messagerK   s        r1   test_should_cache_errors(TestShouldCache.test_should_cache_errors;  s9     cBh]]>=s+> >==s   A
ArR  r  r  c                 :    [         R                  " U5      SL d   eg )NT)r}  rQ  )r,   rR  s     r1   &test_no_slicing_errors_in_should_cache6TestShouldCache.test_no_slicing_errors_in_should_cacheH  s     !!(+t333r4   r  N)r  r  r  r  rf   r  r  rT  rY  r   r   r  r\  r"  r  r4   r1   rM  rM  -  s    [[+U3+T2	


 [[/OE	
?? [[I345:;-./"4I345:;	
44r4   rM  c            	         [        / SQSS9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   ra   Nl            NInt64r#   r&  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*   rV   )rX   ser_copyr9  r0   s       r1   !test_nullable_integer_to_datetimera  U  s    
*'
:CxxzH
c
%CMM9:MM9:MM% MM9:MM% 	
H 3)3)r4   rq  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 datetimerc   r   )r  r   rf   rg   rM  r   r   )nulls_fixturerq  r/   s      r1   test_na_to_datetimerd  j  se    -))]]9,IJ}o./ KJ UM?34ayC KJs   A,,
A:rw   ru   r~   zargs, format)z
03/24/2016z
03/25/2016r   r9   )
2016-03-24
2016-03-25r   r   rL  r'  rM  c                 |    [        U5      n[        X2U S9n[        SS[        /SS9n[        R                  " XT5        g )Nr   re  rf  r  r#   )r   r   r   r*   rV   )rw   rb  rA   r   r/   r0   s         r1   test_empty_string_datetimerh  v  s=     
B 6:F|\37?OPH8,r4   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  z1970-01-01 00:00:01r   r6  r#   ru   r   r/   r0   s     r1   'test_empty_string_datetime_coerce__unitrk    sX     !Rs8<F3U;?SH(+ !Rs7;F(+r4   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DTrN  r   )nrandom_stater5  r   r   )r   r   r   to_framesamplerf  	to_seriesr  r]   r   r|  r*   rV   )rB   cstarttimesr/   r0   s        r1   +test_to_datetime_monotonic_increasing_indexrw    s    Fy(&tDENNTN299FQR9SE++'')007$>EKAqD)7Fzz!Q$H6,r4   series_length(   r   rQ   c                 |   [        [        R                  " S5      /[        R                  " S5      /U -  -   [        S9n[	        USSS9n[        U Vs/ s H  n[        U5      PM     sn5      nUR                  S:X  d   e[        R                  " X$5        [	        USSS9n[        R                  " XT5        g s  snf )	Nz1446-04-12 00:00:00+00:00z1991-10-20 00:00:00+00:00r#   r~   T)rw   r  M8[us, UTC]ru   )	r   r   fromisoformatr(   r   r   r$   r*   rV   )rx  rX   r+  rY   	expected1r-  s         r1   2test_to_datetime_cache_coerce_50_lines_outofboundsr~    s     			 ;	<=""#>?@=P	RC
 #hD9Gc2c	!c23I??m+++7.#g48G7. 3s   B9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=  ra   r  r   r   r   i  )r  r  r  r  r  r_  microsecondr  rJ   )r  timestamp_formatr/   r0   s       r1   %test_to_datetime_format_f_parse_nanosr    sG    /I-<F	H r4   c                  b    [        SS/SS9n [        SS/5      n[        R                  " X5        g )NrP  z2020-01-01 05:00:00r'  r   r  r   rj  s     r1   test_to_datetime_mixed_iso8601r    s3    ,(=>yQF35JKLH&+r4   c                  b    [        SS/SS9n [        SS/5      n[        R                  " X5        g )Nz
01/11/2000z12 January 2000r(  r   z
2000-01-11z
2000-01-12r   rj  s     r1   test_to_datetime_mixed_otherr    s1    ,(9:7KFlL9:H&+r4   r   TFrA   r(  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'rc   rP  )r   rA   r   )r   rA   r   s      r1   #test_to_datetime_mixed_or_iso_exactr    s0     EC	z	-\N%? 
.	-	-rY  c                      [         R                  " [        SS9   [        SS/SS9  S S S 5        g ! , (       d  f       g = f)Nz*Time data 01-01-2000 is not ISO8601 formatrc   rP  
01-01-2000r'  r   r   r  r4   r1   4test_to_datetime_mixed_not_necessarily_iso8601_raiser    s-    	z)U	V\<0C 
W	V	Vr]  c                  j    [        SS/SSS9n [        R                  " U [        S[        /5      5        g )NrP  r  r'  r~   r   r  )r   r*   r+   r   r   )r/   s    r1   5test_to_datetime_mixed_not_necessarily_iso8601_coercer    s5    	|$YxF &-1F0L"MNr4   c                  >    [        SSSS9n [        S5      nX:X  d   eg )N2023-10-15T14:30:00Tr'  r  rA   2023-10-15 14:30:00+00:00rJ   rj  s     r1   )test_to_datetime_iso8601_utc_single_naiver    s(    .DKF45Hr4   c                      SS/n [        U SSS9n[        [        S5      [        S5      /5      n[        R                  " X5        g )Nz2023-10-15T10:30:00-12:00r  Tr'  r  z2023-10-15 22:30:00+00:00r  r   r   r   r*   r+   r   r/   r0   s      r1   2test_to_datetime_iso8601_utc_mixed_negative_offsetr    I    ')>?D4	:F	.	/;V1WXH &+r4   c                      SS/n [        U SSS9n[        [        S5      [        S5      /5      n[        R                  " X5        g )N2023-10-15T10:30:00+08:00r  Tr'  r  2023-10-15 02:30:00+00:00r  r  r  s      r1   2test_to_datetime_iso8601_utc_mixed_positive_offsetr    r  r4   c                      / SQn [        U SSS9n[        [        S5      [        S5      [        S5      /5      n[        R                  " X5        g )N)r  z2023-10-15T12:30:00-05:00r  Tr'  r  r  z2023-10-15 17:30:00+00:00r  r  r  s      r1   /test_to_datetime_iso8601_utc_mixed_both_offsetsr    sS    D
 4	:F121212	
H &+r4   c                     Sn Sn[         R                  " [        US9   [        U 5        S S S 5        [         R                  " [        US9   [	        U 5        S S S 5        [         R                  " [        US9   [	        U /5        S S S 5        g ! , (       d  f       Nj= f! , (       d  f       NN= f! , (       d  f       g = f)Nz2014 Jan 9 05:15 FAKEz .*un-recognized timezone "FAKE".rc   )rf   rg   rh   r   r   )dtstrr   s     r1   test_unknown_tz_raisesr    s}    #E
,C	z	-% 
. 
z	-E 
.	z	-UG 
.	- 
.	- 
.	-	-	-s#   BB8B0
B
B-0
B>c                      Su  p[        U /[        -  U/-   5      nSn[        R                  " [        US9   [        USSSS9  S S S 5        g ! , (       d  f       g = f)N)z
2024-01-01Nz-time data "N" doesn't match format "%Y-%m-%d"rc   r   Tr   )r   r   rf   rg   rh   r   )validr<  rX   r   s       r1   test_unformatted_input_raisesr  (  sO    &NE
%++wi7
8C
:C	z	-C
$dC 
.	-	-s   A
A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   ra   z	[pyarrow]r#   r>  )rf   r  r   lowerr   r*   rV   )any_numeric_ea_dtyperX   r/   r0   s       r1   test_from_numeric_arrow_dtyper  1  s[    
	"
!Q"6"<"<">!?yI
JCFq!f$45H6,r4   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   r(  r   r   r{  r#   )r   r   r   r*   r+   r   )r*  r/   r0   r(  alt2s        r1   6test_to_datetime_with_empty_str_utc_false_format_mixedr  :  so    $b)Dg.Fi 895AWH&+ d
C#(D$)r4   c                      Sn [         R                  " [        U S9   [        / SQSS9  S S S 5        g ! , (       d  f       g = f)Nr   rc   )r  z2020-01-01 00:00+02:00r   r(  r   r   )r   s    r1   Btest_to_datetime_with_empty_str_utc_false_offsets_and_format_mixedr  H  s.    
BC	z	-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+01sMixed timezones detected. Pass utc=True in to_datetime or tz='UTC' in DatetimeIndex to convert to a common timezonerc   r(  r   )r   rf   rg   rh   r   r   )r  r  r.   r   s       r1   &test_to_datetime_mixed_tzs_mixed_typesr  R  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:00rG  r(  r   r	  )r  r  r.   rj  rk  res3res4r0   s           r1   )test_to_datetime_mixed_types_matching_tzsr  e  s    'E	5	B+CsDs4R4y!$B$'Ds7+DDbX&H$)$)$)$)r4   r  z)ignore:Could not infer format:UserWarning	aware_valc                 ,    [        U 5      R                  $ r1  rR  r  r]  s    r1   r^  r^  ~      $q'""r4   	naive_valic                 ,    [        U 5      R                  $ r1  r  r]  s    r1   r^  r^    r  r4   naive_firstc                    XS/nUnU(       a  XS/n[        U [        5      =(       a    [        U[        5      n[        U[        [        45      n[        U[        5      =(       a    [        U [        5      nSn[        S U 5       5      n	[        U	[        5      (       d  Un
U(       aZ  [        U [        5      (       aE  [        U[        5      (       a  Sn
[        R                  " [        U
S9   [        U5        S S S 5        O=U(       d	  U(       a  Sn
[        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OGU(       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        O9Un
[        R                  " [        U
S9   [        U5        S S S 5        [        USS9  U(       a\  Un
[        R                  " [        U
S9   [        USS9  S S S 5        [        R                  " [        U
S9   [        U5        S S S 5        g U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 U(       d	  U(       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 ! , (       d  f       GNF= f! , (       d  f       GNX= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= 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Nl= f! , (       d  f       g = f! , (       d  f       GN%= f! , (       d  f       g = f)Nr   r  c              3   4   #    U  H  oS :w  d  M
  Uv   M     g7f)r   Nr  )r  rY   s     r1   r  ?test_to_datetime_mixed_awareness_mixed_types.<locals>.<genexpr>  s     4SG!!Ss   		z<Tz-aware datetime.datetime cannot be converted to datetime64rc   z(Cannot mix tz-aware with tz-naive valuesTr  z!time data .* doesn't match formatz3time data \"2020-01-01 00:00\" doesn't match formatz1unconverted data remains when parsing with formatr(  r   )r  rU   rV  r]   r   nextr   rf   rg   rh   r   rf  r   )r  r  r  r*  vec	both_strshas_numericboth_datetime	mixed_msgfirst_non_nullr   s              r1   ,test_to_datetime_mixed_awareness_mixed_typesr  z  s    "%D
CR( 9c*Iz)S/IIYe5Ky(3W
9h8WM	; 
 4S44N nc**: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 ]]:S1 2 	CT"]]:S1G, 2]]:S1# 21 :i;;)Y//Tz5C0 6z5c" 65 =@z5C0 6z5c" 65y 65
 65 2111
 2111
 2111
 21 2111 6555
 6555s   -Q6+RR>R,R>S S"S4<T<T(T*T;7U5U!U06
R
R
R),
R;>
S
S"
S14
T
T
T'*
T8;
U

U
U-0
U>c                      [        [        R                  " SS5      /5      n [        S/SS S9n[        R
                  " X5        g )Nl   Mp_$psz1970-01-01 00:00:01.901901901r>  r   r  rj  s     r1   &test_to_datetime_wrapped_datetime64_psr    s?    "--t<=>F	()1AH &+r4   c                     [         R                  " S5      nSnUR                  SU S35      nUR                  S5      S   n[	        [        U/5      SU S9nUR                  S   [        U5      :X  d   eg )	Nz
lxml.etreez2025-02-05 16:59:57z<date>z</date>z/date/node()r   r   r@   )rf   r  XMLxpathr   r   r|  r   )rB   etreer  noder   outs         r1   6test_to_datetime_lxml_elementunicoderesult_with_formatr    sp    -EA99vaS()D
**^
$Q
'C
fcUm,?u
MC88A;)A,&&&r4   )m__doc__r   collectionsr   r   r   r   r   decimalr   r  r  dateutil.parserr	   numpyr&   rf   pandas._libsr
   pandas._libs.tslibsr   r   pandas.compatr   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_testingr*   pandas.core.arraysr   pandas.core.toolsr   r}  pandas.core.tools.datetimesr   r  rf  r  r    r$  r  rX  r  rx  r  r  r  r  r
  r  r  rM  ra  r  r  r'   r  rd  rh  rk  rw  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r]   r  r  r  r  r4   r1   <module>r     s          !    * ) < 
 
 
  , 0 8  	F	' 
 F9U0 U0pN) N)b&N@ N@bU1 U1pT* T*n1 1<o1 o1d?I ?IDm/ m/` 34	 5	 F Fc0 c0L%4 %4P** 288T"23  4  GX#67	):6	):6 
	"  - 8-	,- 	,q04Dq4HJ/	/"$,, 4-0Iw#78@ 9 1@DO,,,&
D-*
&*" 	!u GH
Ie"  
 
3BZ%rwwy"''288U288_U"  
 u6[# 7 I[#|,'r4   