mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
ARROW-425: Add private API to get python Table from a C++ object
Change-Id: Ie24aa9469fad064413be66b7e7e566fbc5b299da
This commit is contained in:
1 parent
7e93075cd4
commit
dc9b814d09
3 files changed
+17
No files matched your search
@@ -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)
|
||||
@@ -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
|
||||
@@ -204,6 +204,10 @@ class build_ext(_build_ext):
|
||||
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):
|
||||
@@ -225,6 +229,13 @@ class build_ext(_build_ext):
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user