Skip to content

Commit

Permalink
feat: add estimated number of rows to CreateReadSession response (#542)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Dec 14, 2022
1 parent 5e2fc1e commit 16c19a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions google/cloud/bigquery_storage_v1/types/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
)
Expand All @@ -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"


Expand Down Expand Up @@ -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",
)
)
Expand All @@ -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"


Expand Down

0 comments on commit 16c19a4

Please sign in to comment.