mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
Fix min mistake, use equals instead of ==
This commit is contained in:
1 parent
2006e7021b
commit
2dffc1412b
3 files changed
+4
-9
No files matched your search
@@ -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():
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user