File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
pandas/tests/indexes/datetimes Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,19 @@ def test_to_datetime_tz(self, cache):
469
469
with pytest .raises (ValueError , match = msg ):
470
470
pd .to_datetime (arr , cache = cache )
471
471
472
+
473
+ @pytest .mark .parametrize ('cache' , [True , False ])
474
+ def test_to_datetime_offset (self , cache ):
475
+ # inspired by asv timeseries.ToDatetimeNONISO8601 benchmark
476
+ # see GH-26097 for more
477
+ ts_string_1 = 'March 1, 2018 12:00:00+0400'
478
+ ts_string_2 = 'March 1, 2018 12:00:00+0500'
479
+ arr = [ts_string_1 ] * 5 + [ts_string_2 ] * 5
480
+ expected = pd .Index ([parse (x ) for x in arr ])
481
+ result = pd .to_datetime (arr , cache = cache )
482
+ tm .assert_index_equal (result , expected )
483
+
484
+
472
485
@pytest .mark .parametrize ('cache' , [True , False ])
473
486
def test_to_datetime_tz_pytz (self , cache ):
474
487
# see gh-8260
You can’t perform that action at this time.
0 commit comments