Skip to content

REGR: fix pd.cut with datetime IntervalIndex as bins #47771

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comment
  • Loading branch information
jorisvandenbossche committed Aug 12, 2022
commit aa4226861afccecc18c6a2f9378103d6a8307f14
3 changes: 3 additions & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3989,6 +3989,9 @@ def _should_partial_index(self, target: Index) -> bool:
if is_interval_dtype(self.dtype):
if is_interval_dtype(target.dtype):
return False
# See https://github.com/pandas-dev/pandas/issues/47772 the commented
# out code can be restored (instead of hardcoding `return True`)
# once that issue if fixed
# "Index" has no attribute "left"
# return self.left._should_compare(target) # type: ignore[attr-defined]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this commented out line work in the future or is it leftover from investigating this fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so that ideally it gets restored in the future. I added a comment referencing the issue I had opened about that

return True
Expand Down