added pyarrow Schema equals, and related def for CSchema

This commit is contained in:
Bryan Cutler committed 2016-11-30 15:10:44 -08:00
1 parent ed6ec3b76e
commit 24cf98270f
2 files changed
+12

No files matched your search

+3
View File
@@ -88,6 +88,9 @@ cdef extern from "arrow/api.h" namespace "arrow" nogil:
cdef cppclass CSchema" arrow::Schema":
CSchema(const vector[shared_ptr[CField]]& fields)
c_bool Equals(const shared_ptr[CSchema]& other)
const shared_ptr[CField]& field(int i)
int num_fields()
c_string ToString()
+9
View File
@@ -110,6 +110,15 @@ cdef class Schema:
self.schema = schema.get()
self.sp_schema = schema
def equals(self, other):
"""
Test if this schema is equal to the other
"""
cdef Schema _other
_other = other
return self.sp_schema.get().Equals(_other.sp_schema)
@classmethod
def from_fields(cls, fields):
cdef: