Skip to content

Commit 4bd3607

Browse files
committed
TST: Check DatetimeIndex.drop on DST boundary
Closes gh-18031.
1 parent 35dd15b commit 4bd3607

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pandas/tests/indexes/datetimes/test_timezones.py

+22
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,28 @@ def test_dti_drop_dont_lose_tz(self):
738738

739739
assert ind.tz is not None
740740

741+
def test_drop_dst_boundary(self):
742+
# see gh-18031
743+
tz = "Europe/Brussels"
744+
freq = "15min"
745+
746+
start = pd.Timestamp("201710290100", tz=tz)
747+
end = pd.Timestamp("201710290300", tz=tz)
748+
index = pd.date_range(start=start, end=end, freq=freq)
749+
750+
expected = DatetimeIndex(["201710290115", "201710290130",
751+
"201710290145", "201710290200",
752+
"201710290215", "201710290230",
753+
"201710290245", "201710290200",
754+
"201710290215", "201710290230",
755+
"201710290245", "201710290300"],
756+
tz=tz, freq=freq,
757+
ambiguous=[True, True, True, True,
758+
True, True, True, False,
759+
False, False, False, False])
760+
result = index.drop(index[0])
761+
tm.assert_index_equal(result, expected)
762+
741763
def test_date_range_localize(self):
742764
rng = date_range('3/11/2012 03:00', periods=15, freq='H',
743765
tz='US/Eastern')

0 commit comments

Comments
 (0)