Class ReadRowsPage (2.13.1)

ReadRowsPage(stream_parser, message)

An iterator of rows from a read session message.

Parameters

NameDescription
stream_parser google.cloud.bigquery_storage_v1.reader._StreamParser

A helper for parsing messages into rows.

message google.cloud.bigquery_storage_v1.types.ReadRowsResponse

A message of data from a read rows stream.

Inheritance

builtins.object > ReadRowsPage

Properties

num_items

int: Total items in the page.

remaining

int: Remaining items in the page.

Methods

__iter__

__iter__()

A ReadRowsPage is an iterator.

__next__

__next__()

Get the next row in the page.

next

next()

Get the next row in the page.

to_arrow

to_arrow()

Create an pyarrow.RecordBatch of rows in the page.

Returns
TypeDescription
pyarrow.RecordBatchRows from the message, as an Arrow record batch.

to_dataframe

to_dataframe(dtypes=None)

Create a pandas.DataFrame of rows in the page.

This method requires the pandas libary to create a data frame and the fastavro library to parse row messages.

.. warning:: DATETIME columns are not supported. They are currently parsed as strings in the fastavro library.

Parameter
NameDescription
dtypes Map[str, Union[str, pandas.Series.dtype]]

Optional. A dictionary of column names pandas dtypes. The provided dtype is used when constructing the series for the column specified. Otherwise, the default pandas behavior is used.

Returns
TypeDescription
pandas.DataFrameA data frame of all rows in the stream.