From 7dfe8f51396acd8eb34a84931f248cc54711c49c Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 21 Jan 2026 20:23:37 +0000 Subject: [PATCH 1/4] drop usage of pytz in tests; add pytz to constraints as a dependency of pandas --- .../bigquery-storage-integration.yaml | 2 ++ .../tests/system/reader/test_reader.py | 3 +-- .../google-cloud-bigquery-storage/tests/unit/helpers.py | 8 +++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.librarian/generator-input/client-post-processing/bigquery-storage-integration.yaml b/.librarian/generator-input/client-post-processing/bigquery-storage-integration.yaml index a782590c69e8..00b9e1682ab9 100644 --- a/.librarian/generator-input/client-post-processing/bigquery-storage-integration.yaml +++ b/.librarian/generator-input/client-post-processing/bigquery-storage-integration.yaml @@ -461,6 +461,8 @@ replacements: google-api-core==1.34.1 libcst==0.2.5 fastavro==0.21.2 + # pytz is required by pandas + pytz pandas==1.0.5 pyarrow==0.15.0 google-auth==2.14.1 diff --git a/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py b/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py index e2b9c9de00b5..7d9182d465ef 100644 --- a/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py +++ b/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py @@ -22,7 +22,6 @@ import uuid import pytest -import pytz from google.cloud import bigquery @@ -451,7 +450,7 @@ def test_decoding_data_types( "bool_field": True, "geography_field": "POINT(-49.3028 69.0622)", "person_struct_field": {"name": "John", "age": 42}, - "timestamp_field": dt.datetime(2019, 8, 9, 13, 38, 22, 17896, tzinfo=pytz.UTC), + "timestamp_field": dt.datetime(2019, 8, 9, 13, 38, 22, 17896, tzinfo=dt.timezone.utc), "date_field": dt.date(1995, 3, 17), "time_field": dt.time(16, 24, 51), "string_array_field": ["foo", "bar", "baz"], diff --git a/packages/google-cloud-bigquery-storage/tests/unit/helpers.py b/packages/google-cloud-bigquery-storage/tests/unit/helpers.py index cd3870425856..efcf6e911f4d 100644 --- a/packages/google-cloud-bigquery-storage/tests/unit/helpers.py +++ b/packages/google-cloud-bigquery-storage/tests/unit/helpers.py @@ -17,8 +17,6 @@ import datetime import decimal -import pytz - SCALAR_COLUMNS = [ {"name": "int_col", "type": "int64"}, {"name": "float_col", "type": "float64"}, @@ -42,7 +40,7 @@ "bytes_col": b"ascii bytes", "date_col": datetime.date(1998, 9, 4), "time_col": datetime.time(12, 0), - "ts_col": datetime.datetime(2000, 1, 1, 5, 0, tzinfo=pytz.utc), + "ts_col": datetime.datetime(2000, 1, 1, 5, 0, tzinfo=datetime.timezone.utc), }, { "int_col": 456, @@ -53,7 +51,7 @@ "bytes_col": b"\xbb\xee\xff", "date_col": datetime.date(1995, 3, 2), "time_col": datetime.time(13, 37), - "ts_col": datetime.datetime(1965, 4, 3, 2, 1, tzinfo=pytz.utc), + "ts_col": datetime.datetime(1965, 4, 3, 2, 1, tzinfo=datetime.timezone.utc), }, ], [ @@ -66,7 +64,7 @@ "bytes_col": b"\x54\x69\x6d", "date_col": datetime.date(1970, 1, 1), "time_col": datetime.time(16, 20), - "ts_col": datetime.datetime(1991, 8, 25, 20, 57, 8, tzinfo=pytz.utc), + "ts_col": datetime.datetime(1991, 8, 25, 20, 57, 8, tzinfo=datetime.timezone.utc), } ], ] From a78e73aa8c26d6c5a325d2730eeb5c41b359184e Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 22 Jan 2026 17:43:45 +0000 Subject: [PATCH 2/4] re-run generation for google-cloud-bigquery-storage --- .librarian/state.yaml | 2 +- packages/google-cloud-bigquery-storage/noxfile.py | 2 -- .../google-cloud-bigquery-storage/testing/constraints-3.7.txt | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.librarian/state.yaml b/.librarian/state.yaml index 32c3e92fbe2a..bc4ffe3bec5c 100644 --- a/.librarian/state.yaml +++ b/.librarian/state.yaml @@ -892,7 +892,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-storage version: 2.36.0 - last_generated_commit: bd94e0b8c4975af0a66dc1f846c63c77dbc0064e + last_generated_commit: 6b36371f6f3099624547e9ce4c1db304161e6afe apis: - path: google/cloud/bigquery/storage/v1beta2 service_config: bigquerystorage_v1beta2.yaml diff --git a/packages/google-cloud-bigquery-storage/noxfile.py b/packages/google-cloud-bigquery-storage/noxfile.py index ac96b51e7a7b..25e0b39cd444 100644 --- a/packages/google-cloud-bigquery-storage/noxfile.py +++ b/packages/google-cloud-bigquery-storage/noxfile.py @@ -55,7 +55,6 @@ PACKAGE_NAME = "google-cloud-bigquery-storage" UNIT_TEST_STANDARD_DEPENDENCIES = [ - "cachetools", "mock", "asyncmock", "pytest", @@ -85,7 +84,6 @@ SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = [] SYSTEM_TEST_DEPENDENCIES: List[str] = [] SYSTEM_TEST_EXTRAS: List[str] = [ - "cryptography", "fastavro", "pandas", "pyarrow", diff --git a/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt b/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt index 9b7d8726b9e1..cae46f0ed788 100644 --- a/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt +++ b/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt @@ -7,6 +7,8 @@ google-api-core==1.34.1 libcst==0.2.5 fastavro==0.21.2 +# pytz is required by pandas +pytz pandas==1.0.5 pyarrow==0.15.0 google-auth==2.14.1 From fa6b3ef99ad2cd6028c2255b899a003ddd4f9a7c Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 22 Jan 2026 18:04:05 +0000 Subject: [PATCH 3/4] apply fix from https://github.com/googleapis/gapic-generator-python/pull/2527 --- .../google-cloud-bigquery-storage/testing/constraints-3.7.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt b/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt index cae46f0ed788..e80388df25cd 100644 --- a/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt +++ b/packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt @@ -12,6 +12,8 @@ pytz pandas==1.0.5 pyarrow==0.15.0 google-auth==2.14.1 +# cryptography is a direct dependency of google-auth +cryptography==38.0.3 # TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) # Add the minimum supported version of grpcio to constraints files proto-plus==1.22.3 From 70bc9375e60c8586d9c29bb638d5bb7bb36a7a87 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 22 Jan 2026 18:06:52 +0000 Subject: [PATCH 4/4] lint --- .../tests/system/reader/test_reader.py | 4 +++- packages/google-cloud-bigquery-storage/tests/unit/helpers.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py b/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py index 7d9182d465ef..e9269bda9d96 100644 --- a/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py +++ b/packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py @@ -450,7 +450,9 @@ def test_decoding_data_types( "bool_field": True, "geography_field": "POINT(-49.3028 69.0622)", "person_struct_field": {"name": "John", "age": 42}, - "timestamp_field": dt.datetime(2019, 8, 9, 13, 38, 22, 17896, tzinfo=dt.timezone.utc), + "timestamp_field": dt.datetime( + 2019, 8, 9, 13, 38, 22, 17896, tzinfo=dt.timezone.utc + ), "date_field": dt.date(1995, 3, 17), "time_field": dt.time(16, 24, 51), "string_array_field": ["foo", "bar", "baz"], diff --git a/packages/google-cloud-bigquery-storage/tests/unit/helpers.py b/packages/google-cloud-bigquery-storage/tests/unit/helpers.py index efcf6e911f4d..b8949ee3df1f 100644 --- a/packages/google-cloud-bigquery-storage/tests/unit/helpers.py +++ b/packages/google-cloud-bigquery-storage/tests/unit/helpers.py @@ -64,7 +64,9 @@ "bytes_col": b"\x54\x69\x6d", "date_col": datetime.date(1970, 1, 1), "time_col": datetime.time(16, 20), - "ts_col": datetime.datetime(1991, 8, 25, 20, 57, 8, tzinfo=datetime.timezone.utc), + "ts_col": datetime.datetime( + 1991, 8, 25, 20, 57, 8, tzinfo=datetime.timezone.utc + ), } ], ]