Skip to content
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

GH-36659: [Python] Fix pyarrow.dataset.Partitioning.__eq__ when comparing with other type #36661

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 2 additions & 3 deletions python/pyarrow/_dataset.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2348,10 +2348,9 @@ cdef class Partitioning(_Weakrefable):
return self.wrapped

def __eq__(self, other):
try:
if isinstance(other, Partitioning):
return self.partitioning.Equals(deref((<Partitioning>other).unwrap()))
except TypeError:
return False
return False

def parse(self, path):
cdef CResult[CExpression] result
Expand Down
1 change: 1 addition & 0 deletions python/pyarrow/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ def test_partitioning():
partitioning = klass(schema)
assert isinstance(partitioning, ds.Partitioning)
assert partitioning == klass(schema)
assert partitioning != "other object"
raulcd marked this conversation as resolved.
Show resolved Hide resolved

schema = pa.schema([
pa.field('group', pa.int64()),
Expand Down