Skip to content
Closed
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
2 changes: 2 additions & 0 deletions python/pyarrow/table.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ cdef class RecordBatch:

cdef init(self, const shared_ptr[CRecordBatch]& table)
cdef _check_nullptr(self)

cdef api object table_from_ctable(const shared_ptr[CTable]& ctable)
4 changes: 4 additions & 0 deletions python/pyarrow/table.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -687,5 +687,9 @@ cdef class Table:
return (self.num_rows, self.num_columns)


cdef api object table_from_ctable(const shared_ptr[CTable]& ctable):
cdef Table table = Table()
table.init(ctable)
return table

from_pandas_dataframe = Table.from_pandas
11 changes: 11 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ def _run_cmake(self):
shutil.move(self.get_ext_built(name), ext_path)
self._found_names.append(name)

if os.path.exists(self.get_ext_built_api_header(name)):
shutil.move(self.get_ext_built_api_header(name),
pjoin(os.path.dirname(ext_path), name + '_api.h'))

os.chdir(saved_cwd)

def _failure_permitted(self, name):
Expand All @@ -225,6 +229,13 @@ def _get_cmake_ext_path(self, name):
filename = name + suffix
return pjoin(package_dir, filename)

def get_ext_built_api_header(self, name):
if sys.platform == 'win32':
head, tail = os.path.split(name)
return pjoin(head, tail + "_api.h")
else:
return pjoin(name + "_api.h")

def get_ext_built(self, name):
if sys.platform == 'win32':
head, tail = os.path.split(name)
Expand Down