This repository was archived by the owner on Jun 8, 2026. It is now read-only.
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: google/cloud/spanner_dbapi/partition_helper.py +2-7Lines changed: 2 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
19 | 19 | import pickle |
20 | 20 | import base64 |
21 | 21 |
|
| 22 | +from google.cloud.spanner_v1 import BatchTransactionId |
| 23 | + |
22 | 24 |
|
23 | 25 | def decode_from_string(encoded_partition_id): |
24 | 26 | gzip_bytes = base64.b64decode(bytes(encoded_partition_id, "utf-8")) |
@@ -33,13 +35,6 @@ def encode_to_string(batch_transaction_id, partition_result): |
33 | 35 | return str(base64.b64encode(gzip_bytes), "utf-8") |
34 | 36 |
|
35 | 37 |
|
36 | | -@dataclass |
37 | | -class BatchTransactionId: |
38 | | - transaction_id: str |
39 | | - session_id: str |
40 | | - read_timestamp: Any |
41 | | - |
42 | | - |
43 | 38 | @dataclass |
44 | 39 | class PartitionId: |
45 | 40 | batch_transaction_id: BatchTransactionId |
|
Collapse file
Copy file name to clipboardExpand all lines: google/cloud/spanner_v1/__init__.py +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
64 | 64 | from .types.type import TypeAnnotationCode |
65 | 65 | from .types.type import TypeCode |
66 | 66 | from .data_types import JsonObject |
| 67 | +from .transaction import BatchTransactionId |
67 | 68 |
|
68 | 69 | from google.cloud.spanner_v1 import param_types |
69 | 70 | from google.cloud.spanner_v1.client import Client |
|
147 | 148 | # google.cloud.spanner_v1.services |
148 | 149 | "SpannerClient", |
149 | 150 | "SpannerAsyncClient", |
| 151 | + "BatchTransactionId", |
150 | 152 | ) |
Collapse file
Copy file name to clipboardExpand all lines: google/cloud/spanner_v1/database.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
40 | 40 | from google.cloud.spanner_admin_database_v1 import RestoreDatabaseRequest |
41 | 41 | from google.cloud.spanner_admin_database_v1 import UpdateDatabaseDdlRequest |
42 | 42 | from google.cloud.spanner_admin_database_v1.types import DatabaseDialect |
43 | | -from google.cloud.spanner_dbapi.partition_helper import BatchTransactionId |
| 43 | +from google.cloud.spanner_v1.transaction import BatchTransactionId |
44 | 44 | from google.cloud.spanner_v1 import ExecuteSqlRequest |
45 | 45 | from google.cloud.spanner_v1 import Type |
46 | 46 | from google.cloud.spanner_v1 import TypeCode |
|
Collapse file
Copy file name to clipboardExpand all lines: google/cloud/spanner_v1/transaction.py +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
36 | 36 | from google.cloud.spanner_v1 import RequestOptions |
37 | 37 | from google.api_core import gapic_v1 |
38 | 38 | from google.api_core.exceptions import InternalServerError |
| 39 | +from dataclasses import dataclass |
| 40 | +from typing import Any |
39 | 41 |
|
40 | 42 |
|
41 | 43 | class Transaction(_SnapshotBase, _BatchBase): |
@@ -554,3 +556,10 @@ def __exit__(self, exc_type, exc_val, exc_tb): |
554 | 556 | self.commit() |
555 | 557 | else: |
556 | 558 | self.rollback() |
| 559 | + |
| 560 | + |
| 561 | +@dataclass |
| 562 | +class BatchTransactionId: |
| 563 | + transaction_id: str |
| 564 | + session_id: str |
| 565 | + read_timestamp: Any |