[x] Added tests for code changes or test/build only changes
[x] Updated the change log file (CHANGES.md|CHANGELOG.md) or test/build only changes
[x] Completed the PR template below:
Description
This PR implements a Document.atomic context manager that don't save a document if there is any uncatched exception in inner code block. Tentatively fixes #427.
Approach
As this change could be breaking (in fact it change a default behaviour) I've decided to implement a brand new context manager using python's contextlib.
When it's needed, one could use atomic as a context manager:
with Document(self.db, 'julia006').atomic() as doc:
Context Manager implementation follow current one, in fact it uses the same dunders.
Checklist
CHANGES.md
|CHANGELOG.md
) or test/build only changesDescription
This PR implements a
Document.atomic
context manager that don't save a document if there is any uncatched exception in inner code block. Tentatively fixes #427.Approach
As this change could be breaking (in fact it change a default behaviour) I've decided to implement a brand new context manager using python's contextlib. When it's needed, one could use
atomic
as a context manager:Context Manager implementation follow current one, in fact it uses the same dunders.
Schema & API Changes
Document.atomic
context managerSecurity and Privacy
Testing
Monitoring and Logging