-
Notifications
You must be signed in to change notification settings - Fork 16
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
instrumented functions aren't pickleable #356
Comments
Title: Update FunctionWrapper to Support Pickling of Instances Analysis When we look at the implementation of FunctionWrapper, we can see that the core issue is the absence of methods that aid the pickling process. Specifically, the wrapper must define reduce_ex (and possibly reduce) methods to allow the pickle module to properly serialize the wrapped object along with its wrapping. Proposed Changes Step-by-Step Changes: Implement the method to return a callable and the arguments needed to recreate the FunctionWrapper instance. Add a test case to check if an instance of FunctionWrapper can be pickled and unpickled without errors. python
Update the test suite to include checks for pickling support: In tests/test_pickle.py test case:
These changes will ensure that the FunctionWrapper class provides full support for pickling, thereby resolving the NotImplementedError and allowing wrapped objects to be serialized and deserialized seamlessly. |
Fixed by #367 |
Trying to pickle a function that has been instrumented will raise an exception. This is almost certainly the cause of these failures:
#318 (comment)
#336 (comment)
and is probably the cause of the failures that show the message
as seen in in #319 (comment)
The text was updated successfully, but these errors were encountered: