Skip to content

Commit eefea36

Browse files
Merge branch 'main' into ci_sharding
2 parents 7ca0171 + 53b48ae commit eefea36

30 files changed

Lines changed: 328 additions & 99 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
permissions:
2+
contents: read
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- 'packages/sqlalchemy-spanner/**'
8+
- '.github/workflows/sqlalchemy-spanner-compliance-tests-against-emulator.yml'
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- 'packages/sqlalchemy-spanner/**'
14+
- '.github/workflows/sqlalchemy-spanner-compliance-tests-against-emulator.yml'
15+
16+
defaults:
17+
run:
18+
working-directory: packages/sqlalchemy-spanner
19+
20+
name: Run SQLAlchemy Spanner compliance tests against emulator
21+
jobs:
22+
check_changes:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
run_sqlalchemy_spanner: ${{ steps.filter.outputs.sqlalchemy_spanner }}
26+
steps:
27+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28+
with:
29+
persist-credentials: false
30+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
31+
id: filter
32+
with:
33+
filters: |
34+
sqlalchemy_spanner:
35+
- 'packages/sqlalchemy-spanner/**'
36+
- '.github/workflows/sqlalchemy-spanner-compliance-tests-against-emulator.yml'
37+
38+
compliance-tests:
39+
needs: check_changes
40+
if: ${{ needs.check_changes.outputs.run_sqlalchemy_spanner == 'true' }}
41+
runs-on: ubuntu-latest
42+
43+
services:
44+
emulator:
45+
image: gcr.io/cloud-spanner-emulator/emulator:latest # zizmor: ignore[unpinned-images]
46+
ports:
47+
- 9010:9010
48+
- 9020:9020
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
53+
with:
54+
persist-credentials: false
55+
- name: Set up Python 3.14
56+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
57+
with:
58+
python-version: "3.14"
59+
- name: Install nox
60+
run: python -m pip install nox
61+
- name: Run nox compliance_test_20
62+
run: nox -s compliance_test_20
63+
env:
64+
SPANNER_EMULATOR_HOST: localhost:9010
65+
GOOGLE_CLOUD_PROJECT: emulator-test-project
66+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true

librarian.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ libraries:
660660
apis:
661661
- path: google/bigtable/v2
662662
- path: google/bigtable/admin/v2
663-
skip_generate: true
664663
python:
665664
library_type: GAPIC_COMBO
666665
opt_args_by_api:

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@
2323

2424
from importlib import metadata
2525

26+
# PEP 0810: Explicit Lazy Imports
27+
# Python 3.15+ natively intercepts and defers these imports.
28+
# Developers can disable this behavior and force eager imports.
29+
# For more information, see:
30+
# https://docs.python.org/3.15/library/sys.html#sys.set_lazy_imports_filter
31+
# Older Python versions safely ignore this variable.
32+
__lazy_modules__ = {
33+
"google.cloud.bigtable_admin_v2.services.bigtable_instance_admin",
34+
"google.cloud.bigtable_admin_v2.services.bigtable_table_admin",
35+
"google.cloud.bigtable_admin_v2.types.bigtable_instance_admin",
36+
"google.cloud.bigtable_admin_v2.types.bigtable_table_admin",
37+
"google.cloud.bigtable_admin_v2.types.common",
38+
"google.cloud.bigtable_admin_v2.types.instance",
39+
"google.cloud.bigtable_admin_v2.types.table",
40+
"google.cloud.bigtable_admin_v2.types.types",
41+
}
42+
43+
2644
from .services.bigtable_instance_admin import (
2745
BigtableInstanceAdminAsyncClient,
2846
BigtableInstanceAdminClient,

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4343,9 +4343,7 @@ async def __aexit__(self, exc_type, exc, tb):
43434343
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
43444344
gapic_version=package_version.__version__
43454345
)
4346-
4347-
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
4348-
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
4346+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
43494347

43504348

43514349
__all__ = ("BigtableInstanceAdminAsyncClient",)

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4832,8 +4832,6 @@ def __exit__(self, type, value, traceback):
48324832
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
48334833
gapic_version=package_version.__version__
48344834
)
4835-
4836-
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
4837-
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
4835+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
48384836

48394837
__all__ = ("BigtableInstanceAdminClient",)

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
3636
gapic_version=package_version.__version__
3737
)
38-
39-
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
40-
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
38+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
4139

4240

4341
class BigtableInstanceAdminTransport(abc.ABC):

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@
5757
rest_version=f"requests@{requests_version}",
5858
)
5959

60-
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
61-
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
60+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
6261

6362

6463
class BigtableInstanceAdminRestInterceptor:

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4961,9 +4961,7 @@ async def __aexit__(self, exc_type, exc, tb):
49614961
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
49624962
gapic_version=package_version.__version__
49634963
)
4964-
4965-
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
4966-
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
4964+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
49674965

49684966

49694967
__all__ = ("BaseBigtableTableAdminAsyncClient",)

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5449,8 +5449,6 @@ def __exit__(self, type, value, traceback):
54495449
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
54505450
gapic_version=package_version.__version__
54515451
)
5452-
5453-
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
5454-
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
5452+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
54555453

54565454
__all__ = ("BaseBigtableTableAdminClient",)

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
3737
gapic_version=package_version.__version__
3838
)
39-
40-
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
41-
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
39+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
4240

4341

4442
class BigtableTableAdminTransport(abc.ABC):

0 commit comments

Comments
 (0)