Pandas version checks
-
[X] I have checked that this issue has not already been reported.
-
[X] I have confirmed this bug exists on the latest version of pandas.
-
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import io
import pandas as pd
buf = io.StringIO("date,value\n2024-01-01 00:00:00,1\n2024-02-01 00:00:00,2")
df = pd.read_csv(buf, parse_dates=["date"])
df.set_index("date").loc["2024-01"] # works
buf = io.StringIO("date,value\n2024-01-01 00:00:00,1\n2024-02-01 00:00:00,2")
df = pd.read_csv(buf, parse_dates=["date"], dtype_backend="pyarrow", engine="pyarrow")
df.set_index("date").loc["2024-01"] # KeyError
```
Issue Description
The pyarrow timestamp type gets put into a generic Index
when assigned via set_index, so the datetime overloads do not work correctly
Expected Behavior
The pyarrow timestamp type should be wrapped by a DatetimeIndex
Installed Versions
3.0.0.dev0+1696.gfae3e8034f'
Comment From: WillAyd
I think this is another one to keep track of for PDEP-13 https://github.com/pandas-dev/pandas/pull/58455
Comment From: AbhishekChaudharii
take
Comment From: robert-schmidtke
Hi, I see that #58455 was closed but this is still open. What's the status of this or are there any recommended workarounds?