Skip to content

Commit 494abcd

Browse files
authored
feat(bigquery): drop Python 3.7-3.9 support and regenerate (#17187)
Updates post processing to account for dropping support for Python 3.7, 3.8, 3.9 and the impacts that has on using 3.10 for lower bounds testing. ### Changes * Resolved Build & Environment Issues: Bumped `pandas`, `pyarrow`, and `opentelemetry` constraints to versions providing native Python 3.10 wheels and avoiding `pkg_resources` failures. * Refactored EOL Checks: Standardised the warning logic using sys.version_info < (3, 10) directly. * Deleted Redundant Helpers: Cleanly removed the custom helper `extract_runtime_version()` and unused sys and _versions_helpers imports. * Aligned Protobuf: Standardised protobuf==4.25.8 to align with the GAPIC templates and the rest of the library families. * Updated post-processing scripts to ensure the above updates pers 🦕
1 parent 03a1333 commit 494abcd

11 files changed

Lines changed: 41 additions & 74 deletions

File tree

librarian.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ libraries:
510510
default_version: v1beta
511511
- name: google-cloud-bigquery
512512
version: 3.41.0
513-
skip_generate: true
514513
python:
515514
library_type: GAPIC_COMBO
516515
metadata_name_override: bigquery
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
2-
"api_id": "bigquery.googleapis.com",
3-
"api_shortname": "bigquery",
42
"client_documentation": "https://cloud.google.com/python/docs/reference/bigquery/latest",
53
"default_version": "v2",
64
"distribution_name": "google-cloud-bigquery",
7-
"issue_tracker": "https://issuetracker.google.com/savedsearches/559654",
85
"language": "python",
96
"library_type": "GAPIC_COMBO",
107
"name": "bigquery",
11-
"name_pretty": "Google Cloud BigQuery",
12-
"product_documentation": "https://cloud.google.com/bigquery",
138
"release_level": "stable",
149
"repo": "googleapis/google-cloud-python"
1510
}

packages/google-cloud-bigquery/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ dependencies.
5252

5353
Supported Python Versions
5454
^^^^^^^^^^^^^^^^^^^^^^^^^
55-
Python >= 3.9
55+
Python >= 3.10
5656

5757
Unsupported Python Versions
5858
^^^^^^^^^^^^^^^^^^^^^^^^^^^
59-
Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, and Python == 3.8.
59+
Python <= 3.9.
6060

6161
The last version of this library compatible with Python 2.7 and 3.5 is
6262
`google-cloud-bigquery==1.28.0`.

packages/google-cloud-bigquery/google/cloud/bigquery/__init__.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- :class:`~google.cloud.bigquery.table.Table` represents a single "relation".
2828
"""
2929

30+
import sys
3031
import warnings
3132

3233
from google.cloud.bigquery import version as bigquery_version
@@ -116,20 +117,16 @@
116117
from google.cloud.bigquery.table import TimePartitioningType
117118
from google.cloud.bigquery.table import TimePartitioning
118119
from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration
119-
from google.cloud.bigquery import _versions_helpers
120120

121121
try:
122122
import bigquery_magics # type: ignore
123123
except ImportError:
124124
bigquery_magics = None
125125

126-
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
127-
128-
if sys_major == 3 and sys_minor in (7, 8):
126+
if sys.version_info < (3, 10):
129127
warnings.warn(
130-
"The python-bigquery library no longer supports Python 3.7 "
131-
"and Python 3.8. "
132-
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
128+
"The python-bigquery library no longer supports Python <= 3.9. "
129+
f"Your Python version is {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}. We "
133130
"recommend that you update soon to ensure ongoing support. For "
134131
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
135132
FutureWarning,

packages/google-cloud-bigquery/google/cloud/bigquery/_versions_helpers.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Shared helper functions for verifying versions of installed modules."""
1615

17-
import sys
1816
from typing import Any
1917

2018
import packaging.version
@@ -249,16 +247,3 @@ def try_import(self, raise_if_error: bool = False) -> Any:
249247
and PYARROW_VERSIONS.try_import() is not None
250248
and PYARROW_VERSIONS.installed_version >= _MIN_PYARROW_VERSION_RANGE
251249
)
252-
253-
254-
def extract_runtime_version():
255-
# Retrieve the version information
256-
version_info = sys.version_info
257-
258-
# Extract the major, minor, and micro components
259-
major = version_info.major
260-
minor = version_info.minor
261-
micro = version_info.micro
262-
263-
# Display the version number in a clear format
264-
return major, minor, micro
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[mypy]
2-
python_version = 3.8
2+
python_version = 3.14
33
namespace_packages = True

packages/google-cloud-bigquery/noxfile.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import nox
2525

26-
MYPY_VERSION = "mypy==1.6.1"
26+
MYPY_VERSION = "mypy<1.16.0"
2727
BLACK_VERSION = "black==23.7.0"
2828
ISORT_VERSION = "isort==5.10.1"
2929
BLACK_PATHS = (
@@ -36,7 +36,8 @@
3636
)
3737

3838
DEFAULT_PYTHON_VERSION = "3.14"
39-
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
39+
ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"]
40+
UNIT_TEST_PYTHON_VERSIONS = ALL_PYTHON
4041
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4142

4243
SYSTEM_TEST_PYTHON_VERSIONS = UNIT_TEST_PYTHON_VERSIONS
@@ -170,12 +171,12 @@ def unit(session, test_type):
170171
# so that it continues to be an optional dependency.
171172
# https://github.com/googleapis/google-cloud-python/issues/1877
172173
if session.python == UNIT_TEST_PYTHON_VERSIONS[0]:
173-
session.install("pyarrow==4.0.0", "numpy==1.20.2")
174+
session.install("pyarrow==6.0.0", "numpy==1.22.0")
174175

175176
default(session, install_extras=install_extras)
176177

177178

178-
@nox.session(python=DEFAULT_PYTHON_VERSION)
179+
@nox.session(python=ALL_PYTHON)
179180
@_calculate_duration
180181
def mypy(session):
181182
"""Run type checks with mypy."""

packages/google-cloud-bigquery/pyproject.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ build-backend = "setuptools.build_meta"
2020
name = "google-cloud-bigquery"
2121
authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }]
2222
license = { text = "Apache 2.0" }
23-
requires-python = ">=3.8"
23+
requires-python = ">=3.10"
2424
description = "Google BigQuery API client library"
2525
readme = "README.rst"
2626
classifiers = [
@@ -32,8 +32,6 @@ classifiers = [
3232
"Intended Audience :: Developers",
3333
"Programming Language :: Python",
3434
"Programming Language :: Python :: 3",
35-
"Programming Language :: Python :: 3.8",
36-
"Programming Language :: Python :: 3.9",
3735
"Programming Language :: Python :: 3.10",
3836
"Programming Language :: Python :: 3.11",
3937
"Programming Language :: Python :: 3.12",
@@ -86,8 +84,7 @@ ipywidgets = ["ipywidgets >= 7.7.1", "ipykernel >= 6.2.0"]
8684
geopandas = ["geopandas >= 0.9.0, < 2.0.0", "Shapely >= 1.8.4, < 3.0.0"]
8785
ipython = ["ipython >= 7.23.1", "bigquery-magics >= 0.6.0"]
8886
matplotlib = [
89-
"matplotlib >= 3.7.1, <= 3.9.2; python_version == '3.9'",
90-
"matplotlib >= 3.10.3; python_version >= '3.10'",
87+
"matplotlib >= 3.10.3",
9188
]
9289
tqdm = ["tqdm >= 4.23.4, < 5.0.0"]
9390
opentelemetry = [

packages/google-cloud-bigquery/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
[pytype]
18-
python_version = 3.8
18+
python_version = 3.10
1919
inputs =
2020
google/cloud/
2121
exclude =
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1+
google-api-core==2.11.1
2+
google-auth==2.14.1
3+
google-cloud-core==2.4.1
4+
google-resumable-media==2.0.0
5+
packaging==24.2.0
6+
python-dateutil==2.8.2
7+
requests==2.21.0
8+
google-cloud-bigquery-storage==2.18.0
19
grpcio==1.47.0
10+
grpcio-status==1.47.0
11+
pyarrow==6.0.0
12+
pandas==1.3.5
13+
pandas-gbq==0.26.1
14+
db-dtypes==1.0.4
15+
ipywidgets==7.7.1
16+
ipykernel==6.2.0
17+
geopandas==0.9.0
18+
Shapely==1.8.4
19+
ipython==7.23.1
20+
bigquery-magics==0.6.0
21+
matplotlib==3.10.3
22+
tqdm==4.23.4
23+
opentelemetry-api==1.16.0
24+
opentelemetry-sdk==1.16.0
25+
opentelemetry-instrumentation==0.37b0
26+
proto-plus==1.22.3
27+
protobuf==4.25.8

0 commit comments

Comments
 (0)