ak._v2.ak_from_arrow.from_arrow

Defined in awkward._v2.operations.convert.ak_from_arrow on line 8.

ak._v2.ak_from_arrow.from_arrow(array, conservative_optiontype=False, highlevel=True, behavior=None)
Parameters
  • (pyarrow.Array (array) – or pyarrow.Table): Apache Arrow array to convert into an Awkward Array.

  • pyarrow.ChunkedArray – or pyarrow.Table): Apache Arrow array to convert into an Awkward Array.

  • pyarrow.RecordBatch – or pyarrow.Table): Apache Arrow array to convert into an Awkward Array.

:paramor pyarrow.Table): Apache Arrow array to convert into an

Awkward Array.

Parameters
  • conservative_optiontype (bool) – If enabled and the optionalness of a type can’t be determined (i.e. not within an pyarrow.field and the Arrow array has no Awkward metadata), assume that it is option-type with a blank BitMaskedArray.

  • highlevel (bool) – If True, return an ak.Array; otherwise, return a low-level ak.layout.Content subclass.

  • behavior (None or dict) – Custom ak.behavior for the output array, if high-level.

Converts an Apache Arrow array into an Awkward Array.

This function always preserves the values of a dataset; i.e. the Python objects returned by ak.to_list are identical to the Python objects returned by Arrow’s to_pylist method. If ak.to_arrow was invoked with extensionarray=True, this function also preserves the data type (high-level ak.types.Type, though not the low-level ak.forms.Form), even through Parquet, making Parquet a good way to save Awkward Arrays for later use.

See also ak.to_arrow, ak.to_arrow_table, ak.from_parquet, ak.from_arrow_schema.