Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 2544afb

Browse files
committed
updates test suite to accommodate new timeout parameter
1 parent 6f0bad0 commit 2544afb

5 files changed

Lines changed: 18 additions & 2 deletions

File tree

google/cloud/bigquery/_pandas_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ def _download_table_bqstorage(
954954
if "@" in table.table_id:
955955
raise ValueError("Reading from a specific snapshot is not currently supported.")
956956

957-
start_time = time.time()
957+
start_time = time.monotonic()
958958
requested_streams = determine_requested_streams(preserve_order, max_stream_count)
959959

960960
requested_session = bigquery_storage.types.stream.ReadSession(

google/cloud/bigquery/dbapi/cursor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ def _bqstorage_fetch(self, bqstorage_client):
323323
read_session=requested_session,
324324
# a single stream only, as DB API is not well-suited for multithreading
325325
max_stream_count=1,
326+
retry=None,
327+
timeout=None,
326328
)
327329

328330
if not read_session.streams:

tests/unit/job/test_query_pandas.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ def test_to_dataframe_bqstorage_preserve_order(query, table_read_options_kwarg):
179179
parent="projects/test-project",
180180
read_session=expected_session,
181181
max_stream_count=1, # Use a single stream to preserve row order.
182+
retry=None,
183+
timeout=None,
182184
)
183185

184186

@@ -593,6 +595,8 @@ def test_to_dataframe_bqstorage(table_read_options_kwarg):
593595
parent="projects/bqstorage-billing-project",
594596
read_session=expected_session,
595597
max_stream_count=0, # Use default number of streams for best performance.
598+
retry=None,
599+
timeout=None,
596600
)
597601
bqstorage_client.read_rows.assert_called_once_with(stream_id)
598602

@@ -644,6 +648,8 @@ def test_to_dataframe_bqstorage_no_pyarrow_compression():
644648
parent="projects/bqstorage-billing-project",
645649
read_session=expected_session,
646650
max_stream_count=0,
651+
retry=None,
652+
timeout=None,
647653
)
648654

649655

tests/unit/test_dbapi_cursor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,11 @@ def fake_ensure_bqstorage_client(bqstorage_client=None, **kwargs):
480480
data_format=bigquery_storage.DataFormat.ARROW,
481481
)
482482
mock_bqstorage_client.create_read_session.assert_called_once_with(
483-
parent="projects/P", read_session=expected_session, max_stream_count=1
483+
parent="projects/P",
484+
read_session=expected_session,
485+
max_stream_count=1,
486+
retry=None,
487+
timeout=None,
484488
)
485489

486490
# Check the data returned.

tests/unit/test_table.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6853,6 +6853,8 @@ def test_to_arrow_iterable_w_bqstorage_max_stream_count(preserve_order):
68536853
parent=mock.ANY,
68546854
read_session=mock.ANY,
68556855
max_stream_count=max_stream_count if not preserve_order else 1,
6856+
retry=None,
6857+
timeout=None,
68566858
)
68576859

68586860

@@ -6888,4 +6890,6 @@ def test_to_dataframe_iterable_w_bqstorage_max_stream_count(preserve_order):
68886890
parent=mock.ANY,
68896891
read_session=mock.ANY,
68906892
max_stream_count=max_stream_count if not preserve_order else 1,
6893+
retry=None,
6894+
timeout=None,
68916895
)

0 commit comments

Comments
 (0)