pyarrow.flight.FlightStreamReader

class pyarrow.flight.FlightStreamReader

Bases: MetadataRecordBatchReader

A reader that can also be canceled.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

cancel(self)

Cancel the read operation.

read_all(self)

Read the entire contents of the stream as a Table.

read_chunk(self)

Read the next FlightStreamChunk along with any metadata.

read_pandas(self, **options)

Read contents of stream to a pandas.DataFrame.

to_reader(self)

Convert this reader into a regular RecordBatchReader.

Attributes

schema

Get the schema for this reader.

cancel(self)

Cancel the read operation.

read_all(self)

Read the entire contents of the stream as a Table.

read_chunk(self)

Read the next FlightStreamChunk along with any metadata.

Returns:
dataFlightStreamChunk

The next FlightStreamChunk in the stream.

app_metadataBuffer or None

Application-specific metadata for the batch as defined by Flight.

Raises:
StopIteration

when the stream is finished

read_pandas(self, **options)

Read contents of stream to a pandas.DataFrame.

Read all record batches as a pyarrow.Table then convert it to a pandas.DataFrame using Table.to_pandas.

Parameters:
**options

Arguments to forward to Table.to_pandas().

Returns:
dfpandas.DataFrame
schema

Get the schema for this reader.

to_reader(self)

Convert this reader into a regular RecordBatchReader.

This may fail if the schema cannot be read from the remote end.

Returns:
RecordBatchReader