-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
A temporary quick fix for dataclass serialization (#500) #503
A temporary quick fix for dataclass serialization (#500) #503
Conversation
This quick fix will be removed when proper dataclass serialization support is added to dill. This is just here to allow for better support, at least for now. dataclasses pickled with this PR will be unpicklable by future versions of dill, but the future versions of dill will be able to be automatically use the newer features in dataclasses.py that were not available in older versions of Python. That forward compatibility features is not present in this PR.
c24b8fb
to
1f5814e
Compare
I'll review this shortly. Note that PyPy-3.7 is failing. |
I think that is an unrelated bug. Creating a new PR (#506) to fix that to make it easier to index later in case there are other changes in PyPy 3.7+. |
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.
This looks reasonable. (1) In the future, if your intent is to replace the newly registered "save" functions with "better" save functions, how would you deal with old stored pickles that use these definitions once a "better" dataclass serialization has been implemented? I assume with _shims
. (2) Should the newly registered types be added to dill._objects
? I should be able to approve this once you've addressed the above question.
The idea is that the current temporary fix does not modify the I think the newly registered types should be added to In summary, as long as we are careful to not lose compatibility in the |
I'm not sure I agree with you.
You are specifically registering a Also... (3) shouldn't these have tags for log tracing?
What if we don't remove these registered types when a we have a Also, FYI, unless a high-priority bug fix comes up, I'm done with new issues for the pending release (although i may, given time, work on #487 or other higher-priority bug fix issues). It seems that with this PR, you are also done with PRs tagged for 0.3.6. @leogama has a few that are still being worked on. There's a soft release deadline for changes on 27 June, so we will assess readiness at that time. |
Ah. Forgot another similarity in all of the In my opinion, there is no need to add every class in Python into |
@anivegesana: let's resolve this. A new release should happen in a few days, at most. |
The last two weeks have been chaotic, so I didn't get to do much. What did we end up deciding? Add the types of dataclass package singletons to |
f35c9c0
to
aa87fe1
Compare
aa87fe1
to
3a1e799
Compare
This quick fix will be removed when proper dataclass serialization support is added to dill. This is just here to allow for better support, at least for now. dataclasses pickled with this PR will be unpicklable by future versions of dill, but the future versions of dill will be able to be automatically use the newer features in dataclasses.py that were not available in older versions of Python. That forward compatibility feature is not present in this PR.