Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 18cb30a

Browse files
committed
fix lint issues
1 parent e942156 commit 18cb30a

File tree

7 files changed

+34
-11
lines changed

7 files changed

+34
-11
lines changed

google/cloud/spanner_dbapi/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ def connect(
808808
if isinstance(credentials, AnonymousCredentials):
809809
client_options = kwargs.get("client_options")
810810
if experimental_host is not None:
811-
project="default"
811+
project = "default"
812812
credentials = AnonymousCredentials()
813813
client_options = ClientOptions(api_endpoint=experimental_host)
814814
client = spanner.Client(

google/cloud/spanner_v1/database.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ def __init__(
205205
pool.bind(self)
206206
is_experimental_host = self._instance.experimental_host is not None
207207

208-
self._sessions_manager = DatabaseSessionsManager(self, pool, is_experimental_host)
208+
self._sessions_manager = DatabaseSessionsManager(
209+
self, pool, is_experimental_host
210+
)
209211

210212
@classmethod
211213
def from_pb(cls, database_pb, instance, pool=None):
@@ -455,7 +457,9 @@ def spanner_api(self):
455457
channel=grpc.insecure_channel(self._instance.experimental_host)
456458
)
457459
self._spanner_api = SpannerClient(
458-
client_info=client_info, transport=transport, client_options=client_options
460+
client_info=client_info,
461+
transport=transport,
462+
client_options=client_options,
459463
)
460464
return self._spanner_api
461465
credentials = self._instance._client.credentials

google/cloud/spanner_v1/testing/database_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def spanner_api(self):
9393
channel = grpc.intercept_channel(channel, *self._interceptors)
9494
transport = SpannerGrpcTransport(channel=channel)
9595
self._spanner_api = SpannerClient(
96-
client_info=client_info, transport=transport, client_options=client_options
96+
client_info=client_info,
97+
transport=transport,
98+
client_options=client_options,
9799
)
98100
return self._spanner_api
99101
credentials = client.credentials

tests/system/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ def not_emulator():
4848
if _helpers.USE_EMULATOR:
4949
pytest.skip(f"{_helpers.USE_EMULATOR_ENVVAR} set in environment.")
5050

51+
5152
@pytest.fixture(scope="module")
5253
def not_experimental_host():
5354
if _helpers.USE_EXPERIMENTAL_HOST:
5455
pytest.skip(f"{_helpers.USE_EXPERIMENTAL_HOST_ENVVAR} set in environment.")
5556

57+
5658
@pytest.fixture(scope="session")
5759
def not_postgres(database_dialect):
5860
if database_dialect == DatabaseDialect.POSTGRESQL:
@@ -115,7 +117,7 @@ def spanner_client():
115117
return spanner_v1.Client(
116118
project=_helpers.EXPERIMENTAL_HOST_PROJECT,
117119
credentials=credentials,
118-
experimental_host=_helpers.EXPERIMENTAL_HOST
120+
experimental_host=_helpers.EXPERIMENTAL_HOST,
119121
)
120122
else:
121123
client_options = {"api_endpoint": _helpers.API_ENDPOINT}

tests/system/test_backup_api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@
2626
Remove {_helpers.SKIP_BACKUP_TESTS_ENVVAR} from environment to run these tests.\
2727
"""
2828
skip_emulator_reason = "Backup operations not supported by emulator."
29-
skip_experimental_host_reason = "Backup operations not supported on experimental host yet."
29+
skip_experimental_host_reason = (
30+
"Backup operations not supported on experimental host yet."
31+
)
3032

3133
pytestmark = [
3234
pytest.mark.skipif(_helpers.SKIP_BACKUP_TESTS, reason=skip_env_reason),
3335
pytest.mark.skipif(_helpers.USE_EMULATOR, reason=skip_emulator_reason),
34-
pytest.mark.skipif(_helpers.USE_EXPERIMENTAL_HOST, reason=skip_experimental_host_reason),
35-
36+
pytest.mark.skipif(
37+
_helpers.USE_EXPERIMENTAL_HOST, reason=skip_experimental_host_reason
38+
),
3639
]
3740

3841

tests/system/test_database_api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747

4848

4949
@pytest.fixture(scope="module")
50-
def multiregion_instance(spanner_client, instance_operation_timeout, not_postgres, not_experimental_host):
50+
def multiregion_instance(
51+
spanner_client, instance_operation_timeout, not_postgres, not_experimental_host
52+
):
5153
multi_region_instance_id = _helpers.unique_id("multi-region")
5254
multi_region_config = "nam3"
5355
config_name = "{}/instanceConfigs/{}".format(
@@ -764,7 +766,11 @@ def test_information_schema_referential_constraints_fkadc(
764766

765767

766768
def test_update_database_success(
767-
not_emulator, not_experimental_host, shared_database, shared_instance, database_operation_timeout
769+
not_emulator,
770+
not_experimental_host,
771+
shared_database,
772+
shared_instance,
773+
database_operation_timeout,
768774
):
769775
old_protection = shared_database.enable_drop_protection
770776
new_protection = True

tests/system/test_dbapi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,13 @@ def test_ping(self):
14361436
@pytest.mark.noautofixt
14371437
def test_user_agent(self, shared_instance, dbapi_database):
14381438
"""Check that DB API uses an appropriate user agent."""
1439-
conn = connect(shared_instance.name, dbapi_database.name, experimental_host=_helpers.EXPERIMENTAL_HOST if _helpers.USE_EXPERIMENTAL_HOST else None)
1439+
conn = connect(
1440+
shared_instance.name,
1441+
dbapi_database.name,
1442+
experimental_host=_helpers.EXPERIMENTAL_HOST
1443+
if _helpers.USE_EXPERIMENTAL_HOST
1444+
else None,
1445+
)
14401446
assert (
14411447
conn.instance._client._client_info.user_agent
14421448
== "gl-dbapi/" + package_version.__version__

0 commit comments

Comments
 (0)