Class: QgsArrowArrayStream

Wrapper around an ArrowArrayStream.

This object provides a helper to allow array streams to be passed to or returned from QGIS functions in C++ or Python. See the documentation for the Arrow C Stream Interface for how to interact with the underlying ArrowArrayStream: https://arrow.apache.org/docs/format/CStreamInterface.html

Added in version 4.0.

List of all members, including inherited members

Constructor

__init__

Methods

cArrayStreamAddress

Returns the address of the underlying ArrowArrayStream for import or export across boundaries

exportToAddress

Export this array to the address of an empty ArrowArrayStream for export across boundaries

isValid

Returns True if this wrapper object holds a valid ArrowArray

Static Methods

fromArrow

Create a QgsArrowArrayStream from any object implementing __arrow_c_stream__().

class qgis.core.QgsArrowArrayStream[source]

Bases: object

__init__()

Construct invalid array stream holder

cArrayStreamAddress(self) int

Returns the address of the underlying ArrowArrayStream for import or export across boundaries

Warning

This is intended for advanced usage and may cause a crash if used incorrectly.

Return type:

int

exportToAddress(self, otherAddress: int)[source]

Export this array to the address of an empty ArrowArrayStream for export across boundaries

Warning

This is intended for advanced usage and may cause a crash if used incorrectly.

Parameters:

otherAddress (int)

static fromArrow(obj: Any) QgsArrowArrayStream[source]

Create a QgsArrowArrayStream from any object implementing __arrow_c_stream__().

Parameters:

obj (Any) – An object implementing the Arrow PyCapsule interface (e.g., pyarrow.RecordBatchReader) or a capsule directly.

Return type:

QgsArrowArrayStream

Returns:

A new QgsArrowArrayStream

Raises:

TypeError – if obj does not implement the Arrow PyCapsule interface.

Added in version 4.2.

isValid(self) bool[source]

Returns True if this wrapper object holds a valid ArrowArray

Return type:

bool