Skip to content

Commit

Permalink
apacheGH-36659: [Python] Fix pyarrow.dataset.Partitioning.__eq__ when…
Browse files Browse the repository at this point in the history
… comparing with other type
  • Loading branch information
jorisvandenbossche committed Jul 13, 2023
1 parent d8a3360 commit 492ba09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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"

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

0 comments on commit 492ba09

Please sign in to comment.