From 4a025b65f84347adb5e33ecadc920abd14ab7e31 Mon Sep 17 00:00:00 2001 From: Linchin Date: Wed, 3 Apr 2024 14:14:35 -0700 Subject: [PATCH] fix: make read_session no longer DEPRECATED --- google/cloud/bigquery_storage_v1/reader.py | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/google/cloud/bigquery_storage_v1/reader.py b/google/cloud/bigquery_storage_v1/reader.py index 0677316c..0b7170ab 100644 --- a/google/cloud/bigquery_storage_v1/reader.py +++ b/google/cloud/bigquery_storage_v1/reader.py @@ -228,11 +228,11 @@ def rows(self, read_session=None): read_session ( \ Optional[~google.cloud.bigquery_storage_v1.types.ReadSession] \ ): - DEPRECATED. - This argument was used to specify the schema of the rows in the stream, but now the first message in a read stream contains - this information. + this information. When row_restriction is applied, some streams + may be empty without read_session info. Provide this argument + to avoid an error. For more information, see https://github.com/googleapis/python-bigquery-storage/issues/733 Returns: Iterable[Mapping]: @@ -250,11 +250,11 @@ def to_arrow(self, read_session=None): read_session ( \ ~google.cloud.bigquery_storage_v1.types.ReadSession \ ): - DEPRECATED. - This argument was used to specify the schema of the rows in the stream, but now the first message in a read stream contains - this information. + this information. When row_restriction is applied, some streams + may be empty without read_session info. Provide this argument + to avoid an error. For more information, see https://github.com/googleapis/python-bigquery-storage/issues/733 Returns: pyarrow.Table: @@ -276,11 +276,11 @@ def to_dataframe(self, read_session=None, dtypes=None): read_session ( \ ~google.cloud.bigquery_storage_v1.types.ReadSession \ ): - DEPRECATED. - This argument was used to specify the schema of the rows in the stream, but now the first message in a read stream contains - this information. + this information. When row_restriction is applied, some streams + may be empty without read_session info. Provide this argument + to avoid an error. For more information, see https://github.com/googleapis/python-bigquery-storage/issues/733 dtypes ( \ Map[str, Union[str, pandas.Series.dtype]] \ ): @@ -308,11 +308,11 @@ class ReadRowsIterable(object): read_session ( \ Optional[~google.cloud.bigquery_storage_v1.types.ReadSession] \ ): - DEPRECATED. - This argument was used to specify the schema of the rows in the stream, but now the first message in a read stream contains - this information. + this information. When row_restriction is applied, some streams + may be empty without read_session info. Provide this argument + to avoid an error. For more information, see https://github.com/googleapis/python-bigquery-storage/issues/733ß """ # This class is modelled after the google.cloud.bigquery.table.RowIterator