From 2ca50b6bec2ee45590866852b517a458f604649a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Swe=C3=B1a?= Date: Fri, 12 Jun 2026 18:28:28 +0000 Subject: [PATCH 1/2] chore: address pandas 3 failure and remove inherently flaky system test --- .../tests/system/test_pandas.py | 2 +- .../tests/system/test_query.py | 38 +++++-------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-bigquery/tests/system/test_pandas.py b/packages/google-cloud-bigquery/tests/system/test_pandas.py index d1031436ec32..bdac93dba15c 100644 --- a/packages/google-cloud-bigquery/tests/system/test_pandas.py +++ b/packages/google-cloud-bigquery/tests/system/test_pandas.py @@ -1098,7 +1098,7 @@ def test_list_rows_nullable_scalars_dtypes(bigquery_client, scalars_table, max_r # pandas uses Python string and bytes objects. assert df.dtypes["bytes_col"].name == "object" - assert df.dtypes["string_col"].name == "object" + assert df.dtypes["string_col"].name in ("str", "object") @pytest.mark.parametrize( diff --git a/packages/google-cloud-bigquery/tests/system/test_query.py b/packages/google-cloud-bigquery/tests/system/test_query.py index 437c28f73915..69ff08b66073 100644 --- a/packages/google-cloud-bigquery/tests/system/test_query.py +++ b/packages/google-cloud-bigquery/tests/system/test_query.py @@ -12,22 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import concurrent.futures import datetime import decimal from typing import Tuple -from google.api_core import exceptions import pytest - +from google.api_core import exceptions from google.cloud import bigquery from google.cloud.bigquery import enums -from google.cloud.bigquery.query import ArrayQueryParameter -from google.cloud.bigquery.query import ScalarQueryParameter -from google.cloud.bigquery.query import ScalarQueryParameterType -from google.cloud.bigquery.query import StructQueryParameter -from google.cloud.bigquery.query import StructQueryParameterType -from google.cloud.bigquery.query import RangeQueryParameter +from google.cloud.bigquery.query import ( + ArrayQueryParameter, + RangeQueryParameter, + ScalarQueryParameter, + ScalarQueryParameterType, + StructQueryParameter, + StructQueryParameterType, +) @pytest.fixture(params=["INSERT", "QUERY"]) @@ -79,26 +79,6 @@ def test_query_many_columns( assert row[f"col_{column}"] == rowval * column -def test_query_w_timeout(bigquery_client, query_api_method): - job_config = bigquery.QueryJobConfig() - job_config.use_query_cache = False - - query_job = bigquery_client.query( - "SELECT * FROM `bigquery-public-data.github_repos.commits`;", - location="US", - job_config=job_config, - api_method=query_api_method, - ) - - with pytest.raises(concurrent.futures.TimeoutError): - query_job.result(timeout=1) - - # Even though the query takes >1 second, the call to getQueryResults - # should succeed. - assert not query_job.done(timeout=1) - assert bigquery_client.cancel_job(query_job) is not None - - def test_query_statistics(bigquery_client, query_api_method): """ A system test to exercise some of the extended query statistics. From c4473006f01271882517ac97d8e4f2990e28cb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Swe=C3=B1a=20=28Swast=29?= Date: Fri, 12 Jun 2026 16:04:14 -0500 Subject: [PATCH 2/2] add string too --- packages/google-cloud-bigquery/tests/system/test_pandas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery/tests/system/test_pandas.py b/packages/google-cloud-bigquery/tests/system/test_pandas.py index bdac93dba15c..08f20dba71c3 100644 --- a/packages/google-cloud-bigquery/tests/system/test_pandas.py +++ b/packages/google-cloud-bigquery/tests/system/test_pandas.py @@ -1098,7 +1098,7 @@ def test_list_rows_nullable_scalars_dtypes(bigquery_client, scalars_table, max_r # pandas uses Python string and bytes objects. assert df.dtypes["bytes_col"].name == "object" - assert df.dtypes["string_col"].name in ("str", "object") + assert df.dtypes["string_col"].name in ("str", "string", "object") @pytest.mark.parametrize(