From e14d55308f4e22e57e72b80656e9c9ab86359085 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Mon, 15 Aug 2022 12:35:26 -0400 Subject: [PATCH 1/5] fix: updates dataset path --- tests/system/test_read_gbq_with_bqstorage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/test_read_gbq_with_bqstorage.py b/tests/system/test_read_gbq_with_bqstorage.py index 84435b9f..cfb31ea8 100644 --- a/tests/system/test_read_gbq_with_bqstorage.py +++ b/tests/system/test_read_gbq_with_bqstorage.py @@ -50,7 +50,7 @@ def test_large_results(random_dataset, method_under_test): total_amount, passenger_count, trip_distance - FROM `bigquery-public-data.new_york_taxi_trips.tlc_green_trips_2014` + FROM `bigquery-public-data.new_york.tlc_green_trips_2014` -- Select non-null rows for no-copy conversion from Arrow to pandas. WHERE total_amount IS NOT NULL AND passenger_count IS NOT NULL From 6b1f925e76e87f6eb151203d6846f9e10cc81801 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 17 Aug 2022 17:37:54 -0400 Subject: [PATCH 2/5] fix: avoid reusing cached results --- tests/system/test_read_gbq.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/system/test_read_gbq.py b/tests/system/test_read_gbq.py index 0187b69d..5e1f7f51 100644 --- a/tests/system/test_read_gbq.py +++ b/tests/system/test_read_gbq.py @@ -547,7 +547,10 @@ def test_default_dtypes( ): if use_bqstorage_api not in use_bqstorage_apis: pytest.skip(f"use_bqstorage_api={use_bqstorage_api} not supported.") - result = read_gbq(query, use_bqstorage_api=use_bqstorage_api) + result = read_gbq(query, + use_bqstorage_api=use_bqstorage_api, + configuration={'query': {'useQueryCache': False}} + ) pandas.testing.assert_frame_equal(result, expected) From f0da5e70947f7ae1d1915808c4a735995de54a88 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 18 Aug 2022 11:27:59 -0400 Subject: [PATCH 3/5] chore: fixes linting errors --- tests/system/test_read_gbq.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/system/test_read_gbq.py b/tests/system/test_read_gbq.py index 5e1f7f51..822f6b1c 100644 --- a/tests/system/test_read_gbq.py +++ b/tests/system/test_read_gbq.py @@ -547,9 +547,10 @@ def test_default_dtypes( ): if use_bqstorage_api not in use_bqstorage_apis: pytest.skip(f"use_bqstorage_api={use_bqstorage_api} not supported.") - result = read_gbq(query, + result = read_gbq( + query, use_bqstorage_api=use_bqstorage_api, - configuration={'query': {'useQueryCache': False}} + configuration={'query': {'useQueryCache': False}}, ) pandas.testing.assert_frame_equal(result, expected) From a4460e84f24f871482e5a19f6e50039013d74588 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 18 Aug 2022 11:31:38 -0400 Subject: [PATCH 4/5] chore: fixes more linting errors --- tests/system/test_read_gbq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/test_read_gbq.py b/tests/system/test_read_gbq.py index 822f6b1c..5ee17247 100644 --- a/tests/system/test_read_gbq.py +++ b/tests/system/test_read_gbq.py @@ -550,7 +550,7 @@ def test_default_dtypes( result = read_gbq( query, use_bqstorage_api=use_bqstorage_api, - configuration={'query': {'useQueryCache': False}}, + configuration={"query": {"useQueryCache": False}}, ) pandas.testing.assert_frame_equal(result, expected) From a66ec8efe451e8f0e3f7c4dcc16fc368c40aceb8 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 1 Sep 2022 19:02:35 +0000 Subject: [PATCH 5/5] adds comment regarding use of specific parameter to avoid cache mismatch --- tests/system/test_read_gbq.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/system/test_read_gbq.py b/tests/system/test_read_gbq.py index 5ee17247..f9358ef6 100644 --- a/tests/system/test_read_gbq.py +++ b/tests/system/test_read_gbq.py @@ -547,6 +547,8 @@ def test_default_dtypes( ): if use_bqstorage_api not in use_bqstorage_apis: pytest.skip(f"use_bqstorage_api={use_bqstorage_api} not supported.") + # the parameter useQueryCache=False is used in the following function call + # to avoid a failing test due to cached data that may be out of order. result = read_gbq( query, use_bqstorage_api=use_bqstorage_api,