diff --git a/google/cloud/bigquery_storage_v1/types/stream.py b/google/cloud/bigquery_storage_v1/types/stream.py index a9eaa157..437aadfa 100644 --- a/google/cloud/bigquery_storage_v1/types/stream.py +++ b/google/cloud/bigquery_storage_v1/types/stream.py @@ -105,6 +105,11 @@ class ReadSession(proto.Message): are completely consumed. This estimate is based on metadata from the table which might be incomplete or stale. + estimated_row_count (int): + Output only. An estimate on the number of + rows present in this session's streams. This + estimate is based on metadata from the table + which might be incomplete or stale. trace_id (str): Optional. ID set by client to annotate a session identity. This does not need to be @@ -268,6 +273,10 @@ class TableReadOptions(proto.Message): proto.INT64, number=12, ) + estimated_row_count: int = proto.Field( + proto.INT64, + number=14, + ) trace_id: str = proto.Field( proto.STRING, number=13, diff --git a/tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py b/tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py index 539b11e4..791a5f93 100644 --- a/tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py +++ b/tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py @@ -702,6 +702,7 @@ def test_create_read_session(request_type, transport: str = "grpc"): data_format=stream.DataFormat.AVRO, table="table_value", estimated_total_bytes_scanned=3076, + estimated_row_count=2047, trace_id="trace_id_value", avro_schema=avro.AvroSchema(schema="schema_value"), ) @@ -718,6 +719,7 @@ def test_create_read_session(request_type, transport: str = "grpc"): assert response.data_format == stream.DataFormat.AVRO assert response.table == "table_value" assert response.estimated_total_bytes_scanned == 3076 + assert response.estimated_row_count == 2047 assert response.trace_id == "trace_id_value" @@ -763,6 +765,7 @@ async def test_create_read_session_async( data_format=stream.DataFormat.AVRO, table="table_value", estimated_total_bytes_scanned=3076, + estimated_row_count=2047, trace_id="trace_id_value", ) ) @@ -779,6 +782,7 @@ async def test_create_read_session_async( assert response.data_format == stream.DataFormat.AVRO assert response.table == "table_value" assert response.estimated_total_bytes_scanned == 3076 + assert response.estimated_row_count == 2047 assert response.trace_id == "trace_id_value"