Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 16c19a4

Browse files
feat: add estimated number of rows to CreateReadSession response (#542)
* feat: add estimated number of rows to CreateReadSession response PiperOrigin-RevId: 495122850 Source-Link: googleapis/googleapis@83b2baf Source-Link: googleapis/googleapis-gen@6720765 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjcyMDc2NTQzYzQ0ZjZlNGUxNzZkMDRmZDdmMmQ2OTVjZmI2OWVlMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 5e2fc1e commit 16c19a4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

google/cloud/bigquery_storage_v1/types/stream.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ class ReadSession(proto.Message):
105105
are completely consumed. This estimate is based
106106
on metadata from the table which might be
107107
incomplete or stale.
108+
estimated_row_count (int):
109+
Output only. An estimate on the number of
110+
rows present in this session's streams. This
111+
estimate is based on metadata from the table
112+
which might be incomplete or stale.
108113
trace_id (str):
109114
Optional. ID set by client to annotate a
110115
session identity. This does not need to be
@@ -268,6 +273,10 @@ class TableReadOptions(proto.Message):
268273
proto.INT64,
269274
number=12,
270275
)
276+
estimated_row_count: int = proto.Field(
277+
proto.INT64,
278+
number=14,
279+
)
271280
trace_id: str = proto.Field(
272281
proto.STRING,
273282
number=13,

tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ def test_create_read_session(request_type, transport: str = "grpc"):
702702
data_format=stream.DataFormat.AVRO,
703703
table="table_value",
704704
estimated_total_bytes_scanned=3076,
705+
estimated_row_count=2047,
705706
trace_id="trace_id_value",
706707
avro_schema=avro.AvroSchema(schema="schema_value"),
707708
)
@@ -718,6 +719,7 @@ def test_create_read_session(request_type, transport: str = "grpc"):
718719
assert response.data_format == stream.DataFormat.AVRO
719720
assert response.table == "table_value"
720721
assert response.estimated_total_bytes_scanned == 3076
722+
assert response.estimated_row_count == 2047
721723
assert response.trace_id == "trace_id_value"
722724

723725

@@ -763,6 +765,7 @@ async def test_create_read_session_async(
763765
data_format=stream.DataFormat.AVRO,
764766
table="table_value",
765767
estimated_total_bytes_scanned=3076,
768+
estimated_row_count=2047,
766769
trace_id="trace_id_value",
767770
)
768771
)
@@ -779,6 +782,7 @@ async def test_create_read_session_async(
779782
assert response.data_format == stream.DataFormat.AVRO
780783
assert response.table == "table_value"
781784
assert response.estimated_total_bytes_scanned == 3076
785+
assert response.estimated_row_count == 2047
782786
assert response.trace_id == "trace_id_value"
783787

784788

0 commit comments

Comments
 (0)