-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Indexing a timestamp ArrowDtype Index #53652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pandas/core/indexes/base.py
Outdated
@@ -6037,7 +6038,7 @@ def _get_indexer_strict(self, key, axis_name: str_t) -> tuple[Index, np.ndarray] | |||
if isinstance(key, Index): | |||
# GH 42790 - Preserve name from an Index | |||
keyarr.name = key.name | |||
if keyarr.dtype.kind in "mM": | |||
if keyarr.dtype.kind in "mM" and not isinstance(keyarr.dtype, ArrowDtype): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think use lib.is_np_dtype(keyarr.dtype, "mM")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have to include DatetimeTZDtype
here then too based on failing tests so is lib.is_np_dtype(keyarr.dtype, "mM") or isinstance(keyarr.dtype, DatetimeTZDtype)
better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. yes, i think that would be more explicit about the cases that are supposed to go through here
|
||
def test_getitem_pyarrow_index(self, frame_or_series): | ||
# GH 53644 | ||
pytest.importorskip("pyarrow") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isnt there a decorator for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is, but I think that decorator can be eventually replaced with this builtin pytest functionality
small comment, also needs rebase. otherwise LGTM |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
* Backport PR #53652: BUG: Indexing a timestamp ArrowDtype Index * Check for np.dtype only
* BUG: Indexing a timestamp ArrowDtype Index * more explicit check
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.