Skip to content

Commit

Permalink
Fix Python bindings after API changes
Browse files Browse the repository at this point in the history
Change-Id: I2a766592124713840a28109b39a6ba0410380382
  • Loading branch information
wesm committed Jan 21, 2017
1 parent 645a329 commit c88e61a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions python/pyarrow/includes/libarrow_ipc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ cdef extern from "arrow/ipc/file.h" namespace "arrow::ipc" nogil:
CStatus Open(OutputStream* sink, const shared_ptr[CSchema]& schema,
shared_ptr[CFileWriter]* out)

CStatus WriteRecordBatch(const vector[shared_ptr[CArray]]& columns,
int32_t num_rows)
CStatus WriteRecordBatch(const CRecordBatch& batch)

CStatus Close()

Expand Down
5 changes: 3 additions & 2 deletions python/pyarrow/ipc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# distutils: language = c++
# cython: embedsignature = True

from cython.operator cimport dereference as deref

from pyarrow.includes.libarrow cimport *
from pyarrow.includes.libarrow_io cimport *
from pyarrow.includes.libarrow_ipc cimport *
Expand Down Expand Up @@ -58,10 +60,9 @@ cdef class ArrowFileWriter:
self.close()

def write_record_batch(self, RecordBatch batch):
cdef CRecordBatch* bptr = batch.batch
with nogil:
check_status(self.writer.get()
.WriteRecordBatch(bptr.columns(), bptr.num_rows()))
.WriteRecordBatch(deref(batch.batch)))

def close(self):
with nogil:
Expand Down

0 comments on commit c88e61a

Please sign in to comment.