|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | """User-friendly container for Cloud Spanner Database.""" |
| 16 | + |
16 | 17 | __CROSS_SYNC_OUTPUT__ = "google.cloud.spanner_v1.database" |
17 | 18 | import copy |
18 | 19 | import functools |
@@ -230,11 +231,7 @@ def __init__( |
230 | 231 | self._experimental_host = ( |
231 | 232 | self._instance.experimental_host if self._instance else None |
232 | 233 | ) |
233 | | - is_experimental_host = self._experimental_host is not None |
234 | | - |
235 | | - self._sessions_manager = DatabaseSessionsManager( |
236 | | - self, pool |
237 | | - ) |
| 234 | + self._sessions_manager = DatabaseSessionsManager(self, pool) |
238 | 235 |
|
239 | 236 | @property |
240 | 237 | def _resource_info(self): |
@@ -1522,7 +1519,9 @@ async def __aenter__(self): |
1522 | 1519 | event_attributes={"id": self._session.session_id}, |
1523 | 1520 | ) |
1524 | 1521 |
|
1525 | | - batch = self._batch = Batch(session=self._session, client_context=self._client_context) |
| 1522 | + batch = self._batch = Batch( |
| 1523 | + session=self._session, client_context=self._client_context |
| 1524 | + ) |
1526 | 1525 | if self._request_options.transaction_tag: |
1527 | 1526 | batch.transaction_tag = self._request_options.transaction_tag |
1528 | 1527 |
|
@@ -1588,7 +1587,9 @@ async def __aenter__(self): |
1588 | 1587 | transaction_type |
1589 | 1588 | ) |
1590 | 1589 |
|
1591 | | - return MutationGroups(session=self._session, client_context=self._client_context) |
| 1590 | + return MutationGroups( |
| 1591 | + session=self._session, client_context=self._client_context |
| 1592 | + ) |
1592 | 1593 |
|
1593 | 1594 | @CrossSync.convert(sync_name="__exit__") |
1594 | 1595 | async def __aexit__(self, exc_type, exc_val, exc_tb): |
@@ -1711,7 +1712,9 @@ def from_dict(cls, database, mapping): |
1711 | 1712 | instance._session_id = session._session_id = mapping["session_id"] |
1712 | 1713 | instance._client_context = mapping.get("client_context") |
1713 | 1714 |
|
1714 | | - snapshot = instance._snapshot = session.snapshot(client_context=instance._client_context) |
| 1715 | + snapshot = instance._snapshot = session.snapshot( |
| 1716 | + client_context=instance._client_context |
| 1717 | + ) |
1715 | 1718 | instance._transaction_id = snapshot._transaction_id = mapping["transaction_id"] |
1716 | 1719 |
|
1717 | 1720 | return instance |
|
0 commit comments