-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORM: raise when trying to pickle instance of
Entity
(#5549)
The ORM entities should not be pickled since it is not clear whether the connection to the storage backend should be included as well and if it were, implementing that in a consistent way across implementations is not feasible. Therefore, we now raise an explicit an `InvalidOperation` when an instance of `Entity` is being pickled. This is achieved by overriding the `__getstate__` dunder method which will be called by the `pickle` module when dumping a class instance.
- Loading branch information
Showing
2 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters