Skip to content

#61382: FIX MultiIndex.difference for pyarrow-backed Timestamps #62127

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

Closed
wants to merge 1 commit into from

Conversation

arpibad
Copy link

@arpibad arpibad commented Aug 15, 2025

  • Override MultiIndex.difference to handle Timestamp[ns][pyarrow] levels
  • Ensure proper comparison without converting all levels to pandas types
  • Add pytest test for difference with pyarrow-backed MultiIndex

- Override MultiIndex.difference to handle Timestamp[ns][pyarrow] levels
- Ensure proper comparison without converting all levels to pandas types
- Add pytest test for difference with pyarrow-backed MultiIndex
@@ -4135,6 +4135,33 @@ def isin(self, values, level=None) -> npt.NDArray[np.bool_]:
# base class "Index" defined the type as "Callable[[Index, Any, bool], Any]")
rename = Index.set_names # type: ignore[assignment]

def difference(self, other, sort=None):
Copy link
Member

Choose a reason for hiding this comment

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

this seems really unlikely to be the right place to handle this. if you step through the existing implementation, where is the first step that goes wrong?


pytest.importorskip("pyarrow")

def test_difference_with_pyarrow_timestamp():
Copy link
Member

Choose a reason for hiding this comment

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

this would go in tests/indexes/multi/test_setops.py

@arpibad arpibad closed this by deleting the head repository Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants