ARROW-425: Add private API to get python Table from a C++ object

Change-Id: Ie24aa9469fad064413be66b7e7e566fbc5b299da
This commit is contained in:
Uwe L. Korn committed 2016-12-15 07:40:31 +01:00
1 parent 7e93075cd4
commit dc9b814d09
3 files changed
+17

No files matched your search

+2
View File
@@ -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
View File
@@ -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
View File
@@ -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)