Skip to content

Commit 8128341

Browse files
committed
TST: Check DatetimeIndex.drop on DST boundary
Closes pandas-devgh-18031.
1 parent 35dd15b commit 8128341

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
@@ -976,6 +976,28 @@ def test_iteration_preserves_nanoseconds(self, tz):
976976
for i, ts in enumerate(index):
977977
assert ts == index[i]
978978

979+
def test_drop_dst_boundary(self):
980+
# see gh-18031
981+
tz = "Europe/Brussels"
982+
freq = "15min"
983+
984+
start = pd.Timestamp("201710290100", tz=tz)
985+
end = pd.Timestamp("201710290300", tz=tz)
986+
index = pd.date_range(start=start, end=end, freq=freq)
987+
988+
expected = DatetimeIndex(["201710290115", "201710290130",
989+
"201710290145", "201710290200",
990+
"201710290215", "201710290230",
991+
"201710290245", "201710290200",
992+
"201710290215", "201710290230",
993+
"201710290245", "201710290300"],
994+
tz=tz, freq=freq,
995+
ambiguous=[True, True, True, True,
996+
True, True, True, False,
997+
False, False, False, False])
998+
result = index.drop(index[0])
999+
tm.assert_index_equal(result, expected)
1000+
9791001

9801002
class TestDateRange(object):
9811003
"""Tests for date_range with timezones"""

0 commit comments

Comments
 (0)