diff --git a/pandas/tests/indexing/test_partial.py b/pandas/tests/indexing/test_partial.py index 513ca039366cb..350f86b4e9fd0 100644 --- a/pandas/tests/indexing/test_partial.py +++ b/pandas/tests/indexing/test_partial.py @@ -650,3 +650,13 @@ def test_loc_with_list_of_strings_representing_datetimes_not_matched_type( s[labels] with pytest.raises(KeyError, match=msg): df.loc[labels] + + def test_indexing_timeseries_regression(self): + # Issue 34860 + arr = date_range("1/1/2008", "1/1/2009") + result = arr.to_series()["2008"] + + rng = date_range(start="2008-01-01", end="2008-12-31") + expected = Series(rng, index=rng) + + tm.assert_series_equal(result, expected)