@@ -463,7 +463,7 @@ def test_to_datetime_parse_tzname_or_tzoffset_utc_false_removed(
463463 self , fmt , dates , expected_dates
464464 ):
465465 # GH#13486, GH#50887, GH#57275
466- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
466+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
467467 with pytest .raises (ValueError , match = msg ):
468468 to_datetime (dates , format = fmt )
469469
@@ -646,7 +646,7 @@ def test_to_datetime_mixed_dt_and_str_with_format_mixed_offsets_utc_false_remove
646646 args = ["2000-01-01 01:00:00" , "2000-01-01 02:00:00+00:00" ]
647647 ts1 = constructor (args [0 ])
648648 ts2 = args [1 ]
649- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
649+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
650650
651651 with pytest .raises (ValueError , match = msg ):
652652 to_datetime ([ts1 , ts2 ], format = fmt , utc = False )
@@ -679,7 +679,7 @@ def test_to_datetime_mixed_offsets_with_none_tz_utc_false_removed(
679679 ):
680680 # https://github.com/pandas-dev/pandas/issues/50071
681681 # GH#57275
682- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
682+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
683683
684684 with pytest .raises (ValueError , match = msg ):
685685 to_datetime (
@@ -1152,7 +1152,7 @@ def test_to_datetime_different_offsets_removed(self, cache):
11521152 ts_string_1 = "March 1, 2018 12:00:00+0400"
11531153 ts_string_2 = "March 1, 2018 12:00:00+0500"
11541154 arr = [ts_string_1 ] * 5 + [ts_string_2 ] * 5
1155- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
1155+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
11561156 with pytest .raises (ValueError , match = msg ):
11571157 to_datetime (arr , cache = cache )
11581158
@@ -1509,7 +1509,7 @@ def test_to_datetime_coerce(self):
15091509 "March 1, 2018 12:00:00+0500" ,
15101510 "20100240" ,
15111511 ]
1512- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
1512+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
15131513 with pytest .raises (ValueError , match = msg ):
15141514 to_datetime (ts_strings , errors = "coerce" )
15151515
@@ -1581,7 +1581,7 @@ def test_iso_8601_strings_with_same_offset(self):
15811581 def test_iso_8601_strings_with_different_offsets_removed (self ):
15821582 # GH#17697, GH#11736, GH#50887, GH#57275
15831583 ts_strings = ["2015-11-18 15:30:00+05:30" , "2015-11-18 16:30:00+06:30" , NaT ]
1584- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
1584+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
15851585 with pytest .raises (ValueError , match = msg ):
15861586 to_datetime (ts_strings )
15871587
@@ -1608,7 +1608,7 @@ def test_mixed_offsets_with_native_datetime_utc_false_raises(self):
16081608 ser = Series (vals )
16091609 assert all (ser [i ] is vals [i ] for i in range (len (vals ))) # GH#40111
16101610
1611- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
1611+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
16121612 with pytest .raises (ValueError , match = msg ):
16131613 to_datetime (ser )
16141614
@@ -1673,7 +1673,7 @@ def test_to_datetime_fixed_offset(self):
16731673 )
16741674 def test_to_datetime_mixed_offsets_with_utc_false_removed (self , date ):
16751675 # GH#50887, GH#57275
1676- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
1676+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
16771677 with pytest .raises (ValueError , match = msg ):
16781678 to_datetime (date , utc = False )
16791679
@@ -3463,7 +3463,7 @@ def test_to_datetime_with_empty_str_utc_false_format_mixed():
34633463
34643464def test_to_datetime_with_empty_str_utc_false_offsets_and_format_mixed ():
34653465 # GH#50887, GH#57275
3466- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
3466+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
34673467
34683468 with pytest .raises (ValueError , match = msg ):
34693469 to_datetime (
@@ -3479,7 +3479,7 @@ def test_to_datetime_mixed_tzs_mixed_types():
34793479 arr = [ts , dtstr ]
34803480
34813481 msg = (
3482- "Mixed timezones detected. pass utc=True in to_datetime or tz='UTC' "
3482+ "Mixed timezones detected. Pass utc=True in to_datetime or tz='UTC' "
34833483 "in DatetimeIndex to convert to a common timezone"
34843484 )
34853485 with pytest .raises (ValueError , match = msg ):
@@ -3578,15 +3578,15 @@ def test_to_datetime_mixed_awareness_mixed_types(aware_val, naive_val, naive_fir
35783578 to_datetime (vec , utc = True )
35793579
35803580 else :
3581- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
3581+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
35823582 with pytest .raises (ValueError , match = msg ):
35833583 to_datetime (vec )
35843584
35853585 # No warning/error with utc=True
35863586 to_datetime (vec , utc = True )
35873587
35883588 if both_strs :
3589- msg = "cannot parse datetimes with mixed time zones unless ` utc=True` "
3589+ msg = "Mixed timezones detected. Pass utc=True in to_datetime "
35903590 with pytest .raises (ValueError , match = msg ):
35913591 to_datetime (vec , format = "mixed" )
35923592 with pytest .raises (ValueError , match = msg ):
0 commit comments