From 72503c21cd522158b2952cbc4bea7577b101cb31 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Tue, 20 Oct 2026 17:07:04 +0000 Subject: [PATCH 1/2] fix(bigquery): require bqstorage 2.43.0 ARROW query results need ReadRowsStream.cancel(), first released in google-cloud-bigquery-storage 2.43.0, but the bqstorage extra still allowed 2.29.0. Installing google-cloud-bigquery[bqstorage] could leave callers with a version that fails at query time. Raise the bqstorage extra and the 3.10 constraints to 2.43.0, and point the ARROW dependency error at the extra, so the version is only set in pyproject.toml. --- .../google/cloud/bigquery/_arrow_query.py | 7 +++---- packages/google-cloud-bigquery/pyproject.toml | 2 +- .../google-cloud-bigquery/testing/constraints-3.10.txt | 2 +- .../tests/unit/test_query_results_format_arrow.py | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py b/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py index ca98bc18f39d..23b2a178b1cf 100644 --- a/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py +++ b/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py @@ -81,10 +81,9 @@ def _check_dependencies() -> None: _versions_helpers.BQ_STORAGE_VERSIONS.try_import(raise_if_error=True) if not _versions_helpers.BQ_STORAGE_VERSIONS.supports_arrow_serialization_options: raise exceptions.LegacyBigQueryStorageError( - "query_results_format=ARROW needs a google-cloud-bigquery-storage " - "release whose BigQueryReadClient.read_rows() accepts " - "arrow_serialization_options, please upgrade it " - "(`pip install --upgrade google-cloud-bigquery-storage`) " + "query_results_format=ARROW needs a newer google-cloud-bigquery-storage, " + "please upgrade it " + '(`pip install --upgrade "google-cloud-bigquery[bqstorage]"`) ' "(version found: " f"{_versions_helpers.BQ_STORAGE_VERSIONS.installed_version})." ) diff --git a/packages/google-cloud-bigquery/pyproject.toml b/packages/google-cloud-bigquery/pyproject.toml index 82d8e2219eee..b0936b70c72b 100644 --- a/packages/google-cloud-bigquery/pyproject.toml +++ b/packages/google-cloud-bigquery/pyproject.toml @@ -60,7 +60,7 @@ Repository = "https://github.com/googleapis/google-cloud-python/tree/main/packag # moved back to optional due to bloat. See # https://github.com/googleapis/python-bigquery/issues/1196 for more background. bqstorage = [ - "google-cloud-bigquery-storage >= 2.29.0, < 3.0.0", + "google-cloud-bigquery-storage >= 2.43.0, < 3.0.0", # Due to an issue in pip's dependency resolver, the `grpc` extra is not # installed, even though `google-cloud-bigquery-storage` specifies it # as `google-api-core[grpc]`. We thus need to explicitly specify it here. diff --git a/packages/google-cloud-bigquery/testing/constraints-3.10.txt b/packages/google-cloud-bigquery/testing/constraints-3.10.txt index d9c428673b02..4f8a652e1312 100644 --- a/packages/google-cloud-bigquery/testing/constraints-3.10.txt +++ b/packages/google-cloud-bigquery/testing/constraints-3.10.txt @@ -5,7 +5,7 @@ google-resumable-media==2.0.0 packaging==24.2.0 python-dateutil==2.8.2 requests==2.33.0 -google-cloud-bigquery-storage==2.29.0 +google-cloud-bigquery-storage==2.43.0 grpcio==1.59.0 grpcio-status==1.59.0 pyarrow==6.0.0 diff --git a/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py b/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py index 1855d854c470..7f29e1915f19 100644 --- a/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py +++ b/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py @@ -774,7 +774,7 @@ def test_check_dependencies_requires_read_rows_arrow_options(supported): else: with pytest.raises( exceptions.LegacyBigQueryStorageError, - match=r"pip install --upgrade google-cloud-bigquery-storage.*" + match=r'pip install --upgrade "google-cloud-bigquery\[bqstorage\]".*' r"\(version found: 2\.42\.0\)", ): _check_dependencies() From 67bb0fe43dc9878edb5cf92b3c556eb7ba7da1ba Mon Sep 17 00:00:00 2001 From: ohmayr Date: Tue, 20 Oct 2026 19:34:44 +0000 Subject: [PATCH 2/2] fix(bigquery): drop --upgrade from the bqstorage install hint pip already upgrades google-cloud-bigquery-storage when the installed version doesn't meet the bqstorage extra's floor. --upgrade would also upgrade google-cloud-bigquery itself, which the error doesn't ask for. --- .../google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py | 2 +- .../tests/unit/test_query_results_format_arrow.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py b/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py index 23b2a178b1cf..443f5c5d4e91 100644 --- a/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py +++ b/packages/google-cloud-bigquery/google/cloud/bigquery/_arrow_query.py @@ -83,7 +83,7 @@ def _check_dependencies() -> None: raise exceptions.LegacyBigQueryStorageError( "query_results_format=ARROW needs a newer google-cloud-bigquery-storage, " "please upgrade it " - '(`pip install --upgrade "google-cloud-bigquery[bqstorage]"`) ' + '(`pip install "google-cloud-bigquery[bqstorage]"`) ' "(version found: " f"{_versions_helpers.BQ_STORAGE_VERSIONS.installed_version})." ) diff --git a/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py b/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py index 7f29e1915f19..4f55169b8622 100644 --- a/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py +++ b/packages/google-cloud-bigquery/tests/unit/test_query_results_format_arrow.py @@ -774,7 +774,7 @@ def test_check_dependencies_requires_read_rows_arrow_options(supported): else: with pytest.raises( exceptions.LegacyBigQueryStorageError, - match=r'pip install --upgrade "google-cloud-bigquery\[bqstorage\]".*' + match=r'pip install "google-cloud-bigquery\[bqstorage\]".*' r"\(version found: 2\.42\.0\)", ): _check_dependencies()