Repository navigation
fix(api-core): make RetryError picklable - #18963
yashgupta29032006 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a __reduce__ method in google/api_core/exceptions.py to support pickling and copying of exception objects, adds corresponding unit tests, and updates docstrings in the Firestore client. The review feedback correctly points out that the current __reduce__ implementation only returns a 2-tuple, which would discard other instance attributes stored in __dict__. It is recommended to return a 3-tuple containing self.__dict__ to preserve all state, and to update the unit tests to verify that custom attributes are retained and that shallow copying preserves object identity for the exception's cause.
|
Hi maintainers, I’ve opened this PR to address issue #18946 by making RetryError support pickling and copying, with regression tests included. The required multi-approvers check is currently failing because it requires internal approvals. Could someone please review the changes when convenient? Thank you! |
|
Closing as #18947 also addresses the same issue |
Summary
Make
google.api_core.exceptions.RetryErrorsupport pickling and copying.Changes
RetryError.__reduce__()to reconstruct the exception with both its message and cause.Nonecause.Testing
pytest tests/unit/test_exceptions.py -qpytest tests/unit -W "ignore::pytest.PytestDeprecationWarning" -qpytest tests/asyncio -W "ignore::pytest.PytestDeprecationWarning" -qFixes #18946