-
Notifications
You must be signed in to change notification settings - Fork 195
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
Allow user pluggable serializers and add a demonstration ProxyStore serializer #2842
Conversation
This is in expectation of at least one more exception being added related to serialization as part of ongoing serializer plugin work.
…ggable-identifier
m = bytes(t.__module__, encoding="utf-8") | ||
c = bytes(t.__name__, encoding="utf-8") | ||
return m + b' ' + c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be double-check, __name__
and not __qualname__
is intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the cases where __qualname__
and __name__
differ, this is often going to break: the module + name needs to be something importable.
One case that could work, a class defined directly inside another class without any enclosing function/closure, I would have to poke at the import side of things to see how that would work.
…roxystore test, as it cannot be imported when optional proxystore is not installed
This PR rearranges the deserializer identifier handling so as to dynamically load unknown serializers. These should be identified by a module and class name (and that identifier will be generated automatically).
New serializers, implementing SerializerBase, can be implemented and registered for either the
code
ordata
paths in serialization using the existingregister_method_for_*
functions introduced in #2831This PR also introduces an example serializer using this API: it extends dill to use ProxyStore on certain objects determined by a user specified policy.
The API for reconfiguring serializers is rather awkward, as evidenced by one of the ProxyStore test case, but this PR does not attempt to make this any nicer.
Type of change