ReadRowsPage(stream_parser, message)
An iterator of rows from a read session message.
Parameters
Name | Description |
stream_parser |
google.cloud.bigquery_storage_v1beta1.reader._StreamParser
A helper for parsing messages into rows. |
message |
google.cloud.bigquery_storage_v1beta1.types.ReadRowsResponse
A message of data from a read rows stream. |
Inheritance
builtins.object > ReadRowsPageProperties
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.
Type | Description |
pyarrow.RecordBatch | Rows 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.
Name | Description |
dtypes |
Map[str, Union[str, pandas.Series.dtype]]
Optional. A dictionary of column names pandas |
Type | Description |
pandas.DataFrame | A data frame of all rows in the stream. |