Fix AsdfFile pickling for instances without file descriptors#2038
Fix AsdfFile pickling for instances without file descriptors#2038sydduckworth wants to merge 10 commits into
AsdfFile pickling for instances without file descriptors#2038Conversation
There was a problem hiding this comment.
How do the changes in this file relate to this PR? If unrelated would you split them into a different PR?
There was a problem hiding this comment.
Changing get_jsonschema_validators was necessary to fix the pickling issue.
Because of that change, validate became both unused and untested, so I removed it.
Removing validate allowed me to clean up the constructor for ValidatorManager.
I renamed get_jsonschema_validators to just validators because it is now the only thing that ValidatorManager actually returns, and I found the jsonschema part confusing since it isn't really actually related to jsonschema at all (or any more than the input validators are).
|
@braingram I've reverted the public API for Once #2040 is merged I'm going to add The issue I'm now running into is that |
Description
This PR fixes two bugs that prevented
AsdfFileinstances from being pickled, which partially addresses #1782.The result is that now asdf files can be pickled if they don't contain a file descriptor, which basically means files that were created from an in-memory dict.
AsdfObjectinstances were failing to deserialize because of their conflictingdictandUserDictbase classes. Added a manual__reduce__override which resolves the problem.ValidatorManagerto not return local callables defined inside a method, which can't be pickled.ValidatorManagernow returns a newBoundValidatorscallable classValidatorManagerimplementation._tests/test_asdf.pyto verify the limited pickling that is now supported.