Skip to content

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
@jbrockmendel
Copy link
Member

@arpibad you don't want to keep pursuing this?

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