mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
added pyarrow Schema equals, and related def for CSchema
This commit is contained in:
1 parent
ed6ec3b76e
commit
24cf98270f
2 files changed
+12
No files matched your search
@@ -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()
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user