pyarrow.unify_schemas

pyarrow.unify_schemas(schemas)

Unify schemas by merging fields by name.

The resulting schema will contain the union of fields from all schemas. Fields with the same name will be merged. Note that two fields with different types will fail merging.

  • The unified field will inherit the metadata from the schema where

    that field is first defined.

  • The first N fields in the schema will be ordered the same as the

    N fields in the first schema.

The resulting schema will inherit its metadata from the first input schema.

Parameters
schemaslist of Schema

Schemas to merge into a single one.

Returns
Schema
Raises
ArrowInvalid

If any input schema contains fields with duplicate names. If Fields of the same name are not mergeable.