Skip to content

Commit d2f2a03

Browse files
committed
update docstrings
1 parent be49dbc commit d2f2a03

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

google/cloud/datastore/batch.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ def begin(self):
281281
282282
This method is called automatically when entering a with
283283
statement, however it can be called explicitly if you don't want
284-
to use a context manager.
284+
to use a context manager. If used outside a context manager,
285+
`client.get` calls targeting the batch and commit/rollback calls
286+
will need to be managed explicitly as well
285287
286288
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
287289
@@ -365,6 +367,10 @@ def rollback(self):
365367
366368
Marks the batch as aborted (can't be used again).
367369
370+
This is called automatically upon exiting a with statement,
371+
however it can be called explicitly if you don't want to use a
372+
context manager.
373+
368374
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
369375
370376
:raises: :class:`~exceptions.ValueError` if the batch is not

google/cloud/datastore/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def _pop_batch(self):
407407

408408
@property
409409
def current_batch(self):
410-
"""Currently-active batch.
410+
"""Currently-active batch, if within the scope of a Batch context manager.
411411
412412
:rtype: :class:`google.cloud.datastore.batch.Batch`, or an object
413413
implementing its API, or ``NoneType`` (if no batch is active).
@@ -417,7 +417,8 @@ def current_batch(self):
417417

418418
@property
419419
def current_transaction(self):
420-
"""Currently-active transaction.
420+
"""Currently-active transaction, if within the scope of a Transaction
421+
context manager.
421422
422423
:rtype: :class:`google.cloud.datastore.transaction.Transaction`, or an
423424
object implementing its API, or ``NoneType`` (if no transaction

google/cloud/datastore/transaction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ def begin(self, retry=None, timeout=None):
212212
213213
This method is called automatically when entering a with
214214
statement, however it can be called explicitly if you don't want
215-
to use a context manager.
215+
to use a context manager. If used outside a context manager,
216+
`client.get` calls targeting the transaction and commit/rollback calls
217+
will need to be managed explicitly as well.
216218
217219
:type retry: :class:`google.api_core.retry.Retry`
218220
:param retry:

0 commit comments

Comments
 (0)