simplified with pyarrow.schema.Schema.equals

This commit is contained in:
Bryan Cutler committed 2016-12-01 10:00:44 -08:00
1 parent 068bc1bf90
commit edf056e0bf
1 file changed
+3 -5
+3 -5
View File
@@ -432,17 +432,15 @@ def dataframe_from_batches(batches):
shared_ptr[CTable] c_table
Array arr
Schema schema
Schema schema_comp
import pandas as pd
schema = batches[0].schema
# check schemas are equal
for i in range(1, len(batches)):
schema_comp = batches[i].schema
if not schema.sp_schema.get().Equals(schema_comp.sp_schema):
raise ArrowException("Error converting list of RecordBatches to DataFrame, not all schemas are equal")
if any((not schema.equals(other.schema) for other in batches[1:])):
raise ArrowException("Error converting list of RecordBatches to "
"DataFrame, not all schemas are equal")
cdef int K = batches[0].num_columns