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

Commit 9c3db74

Browse files
committed
feat: Multiplexed sessions - Make deprecation comments a bit more clear.
Signed-off-by: Taylor Curran <taylor.curran@improving.com>
1 parent 17f3c5f commit 9c3db74

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

google/cloud/spanner_v1/database.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,9 @@ def _nth_client_id(self):
831831
def session(self, labels=None, database_role=None):
832832
"""Factory to create a session for this database.
833833
834-
Deprecated. Sessions should be checked out using context
835-
managers, rather than retrieved directly from the database.
834+
Deprecated. Sessions should be checked out indirectly using context
835+
managers or :meth:`~google.cloud.spanner_v1.database.Database.run_in_transaction`,
836+
rather than built directly from the database.
836837
837838
:type labels: dict (str -> str) or None
838839
:param labels: (Optional) user-assigned labels for the session.

google/cloud/spanner_v1/pool.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ def _new_session(self):
138138
def session(self, **kwargs):
139139
"""Check out a session from the pool.
140140
141-
Deprecated. Sessions should be checked out using context
142-
managers, rather than directly from the pool.
141+
Deprecated. Sessions should be checked out indirectly using context
142+
managers or :meth:`~google.cloud.spanner_v1.database.Database.run_in_transaction`,
143+
rather than checked out directly from the pool.
143144
144145
:param kwargs: (optional) keyword arguments, passed through to
145146
the returned checkout.
@@ -796,8 +797,9 @@ def begin_pending_transactions(self):
796797
class SessionCheckout(object):
797798
"""Context manager: hold session checked out from a pool.
798799
799-
Deprecated. Sessions should be checked out using context
800-
managers, rather than directly from the pool.
800+
Deprecated. Sessions should be checked out indirectly using context
801+
managers or :meth:`~google.cloud.spanner_v1.database.Database.run_in_transaction`,
802+
rather than checked out directly from the pool.
801803
802804
:type pool: concrete subclass of
803805
:class:`~google.cloud.spanner_v1.pool.AbstractSessionPool`

0 commit comments

Comments
 (0)