From 6aa7d5dd29d3154c6295649a665b6e5a87192aa2 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 13:32:02 -0400 Subject: [PATCH 1/5] feat(bigquery): enable library generation --- librarian.yaml | 1 - packages/google-cloud-bigquery/.repo-metadata.json | 5 ----- 2 files changed, 6 deletions(-) diff --git a/librarian.yaml b/librarian.yaml index 51c51b3ccc83..6fc835c9c133 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -511,7 +511,6 @@ libraries: default_version: v1beta - name: google-cloud-bigquery version: 3.41.0 - skip_generate: true python: library_type: GAPIC_COMBO metadata_name_override: bigquery diff --git a/packages/google-cloud-bigquery/.repo-metadata.json b/packages/google-cloud-bigquery/.repo-metadata.json index 6b55ebc67f39..3a4177f8c27a 100644 --- a/packages/google-cloud-bigquery/.repo-metadata.json +++ b/packages/google-cloud-bigquery/.repo-metadata.json @@ -1,15 +1,10 @@ { - "api_id": "bigquery.googleapis.com", - "api_shortname": "bigquery", "client_documentation": "https://cloud.google.com/python/docs/reference/bigquery/latest", "default_version": "v2", "distribution_name": "google-cloud-bigquery", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559654", "language": "python", "library_type": "GAPIC_COMBO", "name": "bigquery", - "name_pretty": "Google Cloud BigQuery", - "product_documentation": "https://cloud.google.com/bigquery", "release_level": "stable", "repo": "googleapis/google-cloud-python" } \ No newline at end of file From 791d1669f3405265e2b4739af163fbb9cc113a4f Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 16:26:11 -0400 Subject: [PATCH 2/5] chore(bigquery): drop support for Python 3.7, 3.8, and 3.9 --- packages/google-cloud-bigquery/README.rst | 4 +-- .../google/cloud/bigquery/__init__.py | 5 ++- packages/google-cloud-bigquery/mypy.ini | 2 +- packages/google-cloud-bigquery/noxfile.py | 6 ++-- packages/google-cloud-bigquery/pyproject.toml | 7 ++-- packages/google-cloud-bigquery/setup.cfg | 2 +- .../testing/constraints-3.9.txt | 33 ------------------- 7 files changed, 11 insertions(+), 48 deletions(-) delete mode 100644 packages/google-cloud-bigquery/testing/constraints-3.9.txt diff --git a/packages/google-cloud-bigquery/README.rst b/packages/google-cloud-bigquery/README.rst index 23ed9257ddc4..705ef5ce712c 100644 --- a/packages/google-cloud-bigquery/README.rst +++ b/packages/google-cloud-bigquery/README.rst @@ -52,11 +52,11 @@ dependencies. Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.9 +Python >= 3.10 Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, and Python == 3.8. +Python <= 3.9. The last version of this library compatible with Python 2.7 and 3.5 is `google-cloud-bigquery==1.28.0`. diff --git a/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py b/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py index 904bea3d4f90..1df8f3388592 100644 --- a/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py +++ b/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py @@ -125,10 +125,9 @@ sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version() -if sys_major == 3 and sys_minor in (7, 8): +if sys_major == 3 and sys_minor in (7, 8, 9): warnings.warn( - "The python-bigquery library no longer supports Python 3.7 " - "and Python 3.8. " + "The python-bigquery library no longer supports Python 3.7, 3.8, and 3.9. " f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We " "recommend that you update soon to ensure ongoing support. For " "more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)", diff --git a/packages/google-cloud-bigquery/mypy.ini b/packages/google-cloud-bigquery/mypy.ini index beaa679a8d2b..cb397f571128 100644 --- a/packages/google-cloud-bigquery/mypy.ini +++ b/packages/google-cloud-bigquery/mypy.ini @@ -1,3 +1,3 @@ [mypy] -python_version = 3.8 +python_version = 3.10 namespace_packages = True diff --git a/packages/google-cloud-bigquery/noxfile.py b/packages/google-cloud-bigquery/noxfile.py index 2ad39b26263a..738b564b4a85 100644 --- a/packages/google-cloud-bigquery/noxfile.py +++ b/packages/google-cloud-bigquery/noxfile.py @@ -36,7 +36,7 @@ ) DEFAULT_PYTHON_VERSION = "3.14" -UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() SYSTEM_TEST_PYTHON_VERSIONS = UNIT_TEST_PYTHON_VERSIONS @@ -170,12 +170,12 @@ def unit(session, test_type): # so that it continues to be an optional dependency. # https://github.com/googleapis/google-cloud-python/issues/1877 if session.python == UNIT_TEST_PYTHON_VERSIONS[0]: - session.install("pyarrow==4.0.0", "numpy==1.20.2") + session.install("pyarrow==6.0.0", "numpy==1.22.0") default(session, install_extras=install_extras) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python="3.10") @_calculate_duration def mypy(session): """Run type checks with mypy.""" diff --git a/packages/google-cloud-bigquery/pyproject.toml b/packages/google-cloud-bigquery/pyproject.toml index edb36711f9d8..f342efcbfd63 100644 --- a/packages/google-cloud-bigquery/pyproject.toml +++ b/packages/google-cloud-bigquery/pyproject.toml @@ -20,7 +20,7 @@ build-backend = "setuptools.build_meta" name = "google-cloud-bigquery" authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }] license = { text = "Apache 2.0" } -requires-python = ">=3.8" +requires-python = ">=3.10" description = "Google BigQuery API client library" readme = "README.rst" classifiers = [ @@ -32,8 +32,6 @@ classifiers = [ "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -86,8 +84,7 @@ ipywidgets = ["ipywidgets >= 7.7.1", "ipykernel >= 6.2.0"] geopandas = ["geopandas >= 0.9.0, < 2.0.0", "Shapely >= 1.8.4, < 3.0.0"] ipython = ["ipython >= 7.23.1", "bigquery-magics >= 0.6.0"] matplotlib = [ - "matplotlib >= 3.7.1, <= 3.9.2; python_version == '3.9'", - "matplotlib >= 3.10.3; python_version >= '3.10'", + "matplotlib >= 3.10.3", ] tqdm = ["tqdm >= 4.23.4, < 5.0.0"] opentelemetry = [ diff --git a/packages/google-cloud-bigquery/setup.cfg b/packages/google-cloud-bigquery/setup.cfg index d5e734f0f022..11a5971e3f2a 100644 --- a/packages/google-cloud-bigquery/setup.cfg +++ b/packages/google-cloud-bigquery/setup.cfg @@ -15,7 +15,7 @@ # limitations under the License. [pytype] -python_version = 3.8 +python_version = 3.10 inputs = google/cloud/ exclude = diff --git a/packages/google-cloud-bigquery/testing/constraints-3.9.txt b/packages/google-cloud-bigquery/testing/constraints-3.9.txt deleted file mode 100644 index 424bc7d6f928..000000000000 --- a/packages/google-cloud-bigquery/testing/constraints-3.9.txt +++ /dev/null @@ -1,33 +0,0 @@ -# This constraints file is used to make sure that the latest dependency versions -# we claim to support in setup.py are indeed installed in test sessions in the most -# recent Python version supported (3.9 at the time of writing - 2021-05-05). -# -# NOTE: Not comprehensive yet, will eventually be maintained semi-automatically by -# the renovate bot. -bigquery-magics==0.6.0 -db-dtypes==1.0.4 -geopandas==0.9.0 -google-api-core==2.11.1 -google-auth==2.14.1 -google-cloud-bigquery-storage==2.18.0 -google-cloud-core==2.4.1 -google-resumable-media==2.0.0 -grpcio==1.47.0 -grpcio==1.49.1; python_version >= '3.11' -ipywidgets==7.7.1 -ipython==7.23.1 -ipykernel==6.2.0 -opentelemetry-api==1.16.0 -opentelemetry-instrumentation==0.37b0 -opentelemetry-sdk==1.16.0 -numpy==1.20.2 -packaging==24.2.0 -pandas==1.3.0 -pandas-gbq==0.26.1 -proto-plus==1.22.3 -protobuf==3.20.2 -pyarrow==4.0.0 -python-dateutil==2.8.2 -requests==2.21.0 -Shapely==1.8.4 -matplotlib==3.7.1 From ae37da65ddbd7db42538012809db21ba5d7d7219 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 16:35:31 -0400 Subject: [PATCH 3/5] chore(bigquery): align mypy.ini and mypy session with gapic templates --- packages/google-cloud-bigquery/mypy.ini | 2 +- packages/google-cloud-bigquery/noxfile.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery/mypy.ini b/packages/google-cloud-bigquery/mypy.ini index cb397f571128..a3cb5c292172 100644 --- a/packages/google-cloud-bigquery/mypy.ini +++ b/packages/google-cloud-bigquery/mypy.ini @@ -1,3 +1,3 @@ [mypy] -python_version = 3.10 +python_version = 3.14 namespace_packages = True diff --git a/packages/google-cloud-bigquery/noxfile.py b/packages/google-cloud-bigquery/noxfile.py index 738b564b4a85..c576870f9be9 100644 --- a/packages/google-cloud-bigquery/noxfile.py +++ b/packages/google-cloud-bigquery/noxfile.py @@ -23,7 +23,7 @@ import nox -MYPY_VERSION = "mypy==1.6.1" +MYPY_VERSION = "mypy<1.16.0" BLACK_VERSION = "black==23.7.0" ISORT_VERSION = "isort==5.10.1" BLACK_PATHS = ( @@ -36,7 +36,8 @@ ) DEFAULT_PYTHON_VERSION = "3.14" -UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] +ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_PYTHON_VERSIONS = ALL_PYTHON CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() SYSTEM_TEST_PYTHON_VERSIONS = UNIT_TEST_PYTHON_VERSIONS @@ -175,7 +176,7 @@ def unit(session, test_type): default(session, install_extras=install_extras) -@nox.session(python="3.10") +@nox.session(python=ALL_PYTHON) @_calculate_duration def mypy(session): """Run type checks with mypy.""" From 080f9b1f5431bdc1eeceac81d037226880cd43ec Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 16:57:59 -0400 Subject: [PATCH 4/5] refactor(bigquery): simplify EOL Python warning check and update Python 3.10 constraints --- .../google/cloud/bigquery/__init__.py | 10 +++---- .../cloud/bigquery/_versions_helpers.py | 15 ----------- .../testing/constraints-3.10.txt | 26 +++++++++++++++++++ 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py b/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py index 1df8f3388592..d20e288f6ac3 100644 --- a/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py +++ b/packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py @@ -27,6 +27,7 @@ - :class:`~google.cloud.bigquery.table.Table` represents a single "relation". """ +import sys import warnings from google.cloud.bigquery import version as bigquery_version @@ -116,19 +117,16 @@ from google.cloud.bigquery.table import TimePartitioningType from google.cloud.bigquery.table import TimePartitioning from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration -from google.cloud.bigquery import _versions_helpers try: import bigquery_magics # type: ignore except ImportError: bigquery_magics = None -sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version() - -if sys_major == 3 and sys_minor in (7, 8, 9): +if sys.version_info < (3, 10): warnings.warn( - "The python-bigquery library no longer supports Python 3.7, 3.8, and 3.9. " - f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We " + "The python-bigquery library no longer supports Python <= 3.9. " + f"Your Python version is {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}. We " "recommend that you update soon to ensure ongoing support. For " "more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)", FutureWarning, diff --git a/packages/google-cloud-bigquery/google/cloud/bigquery/_versions_helpers.py b/packages/google-cloud-bigquery/google/cloud/bigquery/_versions_helpers.py index cfbf70a8edbe..d856c19852e7 100644 --- a/packages/google-cloud-bigquery/google/cloud/bigquery/_versions_helpers.py +++ b/packages/google-cloud-bigquery/google/cloud/bigquery/_versions_helpers.py @@ -11,10 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - """Shared helper functions for verifying versions of installed modules.""" -import sys from typing import Any import packaging.version @@ -249,16 +247,3 @@ def try_import(self, raise_if_error: bool = False) -> Any: and PYARROW_VERSIONS.try_import() is not None and PYARROW_VERSIONS.installed_version >= _MIN_PYARROW_VERSION_RANGE ) - - -def extract_runtime_version(): - # Retrieve the version information - version_info = sys.version_info - - # Extract the major, minor, and micro components - major = version_info.major - minor = version_info.minor - micro = version_info.micro - - # Display the version number in a clear format - return major, minor, micro diff --git a/packages/google-cloud-bigquery/testing/constraints-3.10.txt b/packages/google-cloud-bigquery/testing/constraints-3.10.txt index c5e37fc9b2dc..b9d85ae6d228 100644 --- a/packages/google-cloud-bigquery/testing/constraints-3.10.txt +++ b/packages/google-cloud-bigquery/testing/constraints-3.10.txt @@ -1 +1,27 @@ +google-api-core==2.11.1 +google-auth==2.14.1 +google-cloud-core==2.4.1 +google-resumable-media==2.0.0 +packaging==24.2.0 +python-dateutil==2.8.2 +requests==2.21.0 +google-cloud-bigquery-storage==2.18.0 grpcio==1.47.0 +grpcio-status==1.47.0 +pyarrow==6.0.0 +pandas==1.3.5 +pandas-gbq==0.26.1 +db-dtypes==1.0.4 +ipywidgets==7.7.1 +ipykernel==6.2.0 +geopandas==0.9.0 +Shapely==1.8.4 +ipython==7.23.1 +bigquery-magics==0.6.0 +matplotlib==3.10.3 +tqdm==4.23.4 +opentelemetry-api==1.16.0 +opentelemetry-sdk==1.16.0 +opentelemetry-instrumentation==0.37b0 +proto-plus==1.22.3 +protobuf==3.20.2 From 7c5252fd4ad7dee5f12c27bec988853e90b5eb33 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 17:04:05 -0400 Subject: [PATCH 5/5] test(bigquery): align Python 3.10 protobuf constraint with standard templates --- packages/google-cloud-bigquery/testing/constraints-3.10.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery/testing/constraints-3.10.txt b/packages/google-cloud-bigquery/testing/constraints-3.10.txt index b9d85ae6d228..c339abd0c5ea 100644 --- a/packages/google-cloud-bigquery/testing/constraints-3.10.txt +++ b/packages/google-cloud-bigquery/testing/constraints-3.10.txt @@ -24,4 +24,4 @@ opentelemetry-api==1.16.0 opentelemetry-sdk==1.16.0 opentelemetry-instrumentation==0.37b0 proto-plus==1.22.3 -protobuf==3.20.2 +protobuf==4.25.8