Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): update docstrings for batches without context managers #578

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

daniel-sanche
Copy link
Contributor

Fixes #447

The library uses context managers to make transaction/batch lifecycle management easier. When in a context manager, all client.get calls will target the active transaciton, and commit/rollback is called automatically when complete

You can also manage the lifecycle explicitly, but you have to manually pass in the transaction when doing client.get calls to avoid contention exceptions.

This PR updates the docstrings to make the contention issue more clear, and adds a test using transactions without context managers

@daniel-sanche daniel-sanche requested review from a team as code owners December 14, 2024 00:48
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: datastore Issues related to the googleapis/python-datastore API. labels Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/python-datastore API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transactions - Bug when using transaction APIs explicitly (not through the context manager)
2 participants