Skip to content

Commit f6f44b6

Browse files
committed
lint
1 parent ffa81ea commit f6f44b6

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

google/cloud/spanner_v1/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
from google.cloud.spanner_admin_instance_v1.services.instance_admin.transports.grpc import (
4242
InstanceAdminGrpcTransport,
4343
)
44-
from google.cloud.spanner_v1 import TransactionOptions
4544
from google.cloud.spanner_admin_instance_v1 import ListInstanceConfigsRequest
4645
from google.cloud.spanner_admin_instance_v1 import ListInstancesRequest
4746
from google.cloud.spanner_v1 import __version__

google/cloud/spanner_v1/session.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
from google.cloud.spanner_v1.batch import Batch
4040
from google.cloud.spanner_v1.snapshot import Snapshot
4141
from google.cloud.spanner_v1.transaction import Transaction
42-
from google.cloud.spanner_v1 import TransactionOptions
43-
4442
from google.cloud.spanner_v1.metrics.metrics_capture import MetricsCapture
4543

4644

noxfile.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,18 @@ def install_systemtest_dependencies(session, *constraints):
294294

295295

296296
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
297-
@nox.parametrize("database_dialect", ["GOOGLE_STANDARD_SQL", "POSTGRESQL"])
298-
def system(session, database_dialect):
297+
@nox.parametrize(
298+
"protobuf_implementation,database_dialect",
299+
[
300+
("python", "GOOGLE_STANDARD_SQL"),
301+
("python", "POSTGRESQL"),
302+
("upb", "GOOGLE_STANDARD_SQL"),
303+
("upb", "POSTGRESQL"),
304+
("cpp", "GOOGLE_STANDARD_SQL"),
305+
("cpp", "POSTGRESQL"),
306+
],
307+
)
308+
def system(session, protobuf_implementation, database_dialect):
299309
"""Run the system test suite."""
300310
constraints_path = str(
301311
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
@@ -329,6 +339,12 @@ def system(session, database_dialect):
329339

330340
install_systemtest_dependencies(session, "-c", constraints_path)
331341

342+
# TODO(https://github.com/googleapis/synthtool/issues/1976):
343+
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
344+
# The 'cpp' implementation requires Protobuf<4.
345+
if protobuf_implementation == "cpp":
346+
session.install("protobuf<4")
347+
332348
# Run py.test against the system tests.
333349
if system_test_exists:
334350
session.run(
@@ -338,6 +354,7 @@ def system(session, database_dialect):
338354
system_test_path,
339355
*session.posargs,
340356
env={
357+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
341358
"SPANNER_DATABASE_DIALECT": database_dialect,
342359
"SKIP_BACKUP_TESTS": "true",
343360
},
@@ -350,6 +367,7 @@ def system(session, database_dialect):
350367
system_test_folder_path,
351368
*session.posargs,
352369
env={
370+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
353371
"SPANNER_DATABASE_DIALECT": database_dialect,
354372
"SKIP_BACKUP_TESTS": "true",
355373
},

tests/unit/test_session.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
Session as SessionRequestProto,
2929
ExecuteSqlRequest,
3030
TypeCode,
31-
Transaction as TransactionPB,
3231
)
3332
from google.cloud._helpers import UTC, _datetime_to_pb_timestamp
3433
from google.cloud.spanner_v1._helpers import _delay_until_retry
@@ -44,7 +43,6 @@
4443
from google.cloud.spanner_v1.snapshot import Snapshot
4544
from google.cloud.spanner_v1.database import Database
4645
from google.cloud.spanner_v1.keyset import KeySet
47-
from google.cloud.spanner_v1.transaction import Transaction
4846
from google.protobuf.duration_pb2 import Duration
4947
from google.rpc.error_details_pb2 import RetryInfo
5048
from google.api_core.exceptions import Unknown, Aborted, NotFound, Cancelled

0 commit comments

Comments
 (0)