pyarrow.union#

pyarrow.union(child_fields, mode, type_codes=None)#

Create UnionType from child fields.

A union is a nested type where each logical value is taken from a single child. A buffer of 8-bit type ids indicates which child a given logical value is to be taken from.

Unions come in two flavors: sparse and dense (see also pyarrow.sparse_union and pyarrow.dense_union).

Parameters:
child_fieldssequence of Field values

Each field must have a UTF8-encoded name, and these field names are part of the type metadata.

modestr

Must be ‘sparse’ or ‘dense’

type_codeslist of integers, default None
Returns:
typeUnionType