Skip to content

Commit

Permalink
Fix min mistake, use equals instead of ==
Browse files Browse the repository at this point in the history
  • Loading branch information
xhochy committed Jun 4, 2016
1 parent 2006e70 commit 2dffc14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions python/pyarrow/array.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,8 @@ cdef class Array:
values = array_format(self, window=10)
return '{0}\n{1}'.format(type_format, values)

def __richcmp__(Array self, Array other, int op):
if op == cpython.Py_EQ:
return self.ap.Equals(other.sp_array)
elif op == cpython.Py_NE:
return not self.ap.Equals(other.sp_array)
else:
raise TypeError('Invalid comparison')
def equals(Array self, Array other):
return self.ap.Equals(other.sp_array)

def __len__(self):
if self.sp_array.get():
Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def write_table(table, filename, chunk_size=None):
cdef shared_ptr[OutputStream] sink = shared_ptr[OutputStream](new LocalFileOutputStream(filename))
cdef int64_t chunk_size_ = 0
if chunk_size is None:
chunk_size_ = max(ctable_.num_rows(), int(2**16))
chunk_size_ = min(ctable_.num_rows(), int(2**16))
else:
chunk_size_ = chunk_size

Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def test_single_pylist_column(tmpdir):
assert col_read.data.num_chunks == 1
data_written = col_written.data.chunk(0)
data_read = col_read.data.chunk(0)
assert data_written == data_read
assert data_written.equals(data_read)

0 comments on commit 2dffc14

Please sign in to comment.