Skip to content

Commit 5365ccc

Browse files
authored
test: prevents query cache reuse that seems to trigger dtypes test failure (#557)
* fix: updates dataset path * fix: avoid reusing cached results * chore: fixes linting errors * chore: fixes more linting errors * adds comment regarding use of specific parameter to avoid cache mismatch
1 parent 2a7074c commit 5365ccc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/system/test_read_gbq.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,13 @@ def test_default_dtypes(
547547
):
548548
if use_bqstorage_api not in use_bqstorage_apis:
549549
pytest.skip(f"use_bqstorage_api={use_bqstorage_api} not supported.")
550-
result = read_gbq(query, use_bqstorage_api=use_bqstorage_api)
550+
# the parameter useQueryCache=False is used in the following function call
551+
# to avoid a failing test due to cached data that may be out of order.
552+
result = read_gbq(
553+
query,
554+
use_bqstorage_api=use_bqstorage_api,
555+
configuration={"query": {"useQueryCache": False}},
556+
)
551557
pandas.testing.assert_frame_equal(result, expected)
552558

553559

tests/system/test_read_gbq_with_bqstorage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_large_results(random_dataset, method_under_test):
5050
total_amount,
5151
passenger_count,
5252
trip_distance
53-
FROM `bigquery-public-data.new_york_taxi_trips.tlc_green_trips_2014`
53+
FROM `bigquery-public-data.new_york.tlc_green_trips_2014`
5454
-- Select non-null rows for no-copy conversion from Arrow to pandas.
5555
WHERE total_amount IS NOT NULL
5656
AND passenger_count IS NOT NULL

0 commit comments

Comments
 (0)