Skip to content

Arrow

obspec.arrow

Arrow type hints.

ArrowArrayExportable

Bases: Protocol

An object with an __arrow_c_array__ method.

Supported objects include:

  • arro3 Array or RecordBatch objects.
  • pyarrow Array or RecordBatch objects

Such an object implements the Arrow C Data Interface interface via the Arrow PyCapsule Interface. This allows for zero-copy Arrow data interchange across libraries.

__arrow_c_array__

__arrow_c_array__(
    requested_schema: object | None = None,
) -> tuple[object, object]

Return Arrow C data interface PyCapsules for the object.

ArrowStreamExportable

Bases: Protocol

An object with an __arrow_c_stream__ method.

Supported objects include:

  • arro3 Table, RecordBatchReader, ChunkedArray, or ArrayReader objects.
  • Polars Series or DataFrame objects (polars v1.2 or higher)
  • pyarrow RecordBatchReader, Table, or ChunkedArray objects (pyarrow v14 or higher)
  • pandas DataFrames (pandas v2.2 or higher)
  • ibis Table objects.

For an up to date list of supported objects, see this issue.

Such an object implements the Arrow C Stream interface via the Arrow PyCapsule Interface. This allows for zero-copy Arrow data interchange across libraries.

__arrow_c_stream__

__arrow_c_stream__(requested_schema: object | None = None) -> object

Return an Arrow C stream interface PyCapsule for the object.