Commit b3b238e
committed
Fix
Summary:
These docs used to be correct, but `Session.run_in_transaction` was
changed from returning the commit timestamp to returning the function
value in googleapis#3753, and the upstream docs were not updated.
The docs for `run_in_transaction` are now identical across `Database`
and `Session`.
The tests for `run_in_transaction` (in `test_database.py`) are wrong, as
they mock out the session object instead of using a real session, and
they also were not updated in googleapis#3753. This change does not fix them.
Test Plan:
```
$ virtualenv -q -p python3.6 ./ve
$ . ./ve/bin/activate
(ve) $ pip install -q google-cloud-spanner==1.10.0
(ve) $ pip freeze | grep google-cloud-spanner
google-cloud-spanner==1.10.0
(ve) $ cat test.py; echo
from google.cloud import spanner_v1
client = spanner_v1.Client()
instance = client.instance("my-instance-name")
database = instance.database("my-database-name")
result = database.run_in_transaction(lambda txn: "ahoy")
print(result)
(ve) $ python test.py
ahoy
```
wchargin-branch: run-in-transaction-rvalrun_in_transaction return value docs1 parent 9023477 commit b3b238e
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
425 | 428 | | |
426 | 429 | | |
427 | 430 | | |
| |||
0 commit comments