Skip to content

Commit 6a6faf5

Browse files
BUG: indexing regression with datetime index (#34917)
1 parent 1237f20 commit 6a6faf5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/indexing/test_partial.py

+10
Original file line numberDiff line numberDiff line change
@@ -650,3 +650,13 @@ def test_loc_with_list_of_strings_representing_datetimes_not_matched_type(
650650
s[labels]
651651
with pytest.raises(KeyError, match=msg):
652652
df.loc[labels]
653+
654+
def test_indexing_timeseries_regression(self):
655+
# Issue 34860
656+
arr = date_range("1/1/2008", "1/1/2009")
657+
result = arr.to_series()["2008"]
658+
659+
rng = date_range(start="2008-01-01", end="2008-12-31")
660+
expected = Series(rng, index=rng)
661+
662+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)