mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
simplified with pyarrow.schema.Schema.equals
This commit is contained in:
1 parent
068bc1bf90
commit
edf056e0bf
1 file changed
+3
-5
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user