-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[FIX] Fix unpickling domains: do not pickle indices (which can cause problems) #6317
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
markotoplak
changed the title
[FIX] Fix unpickling domains in some cases
[FIX] Fix unpickling domains: do not pickle indices that can cause problems
Jan 26, 2023
To see the problems, just run the new |
markotoplak
force-pushed
the
fix-unpickling-domains
branch
from
January 26, 2023 15:40
3ccb3e1
to
53e1948
Compare
markotoplak
changed the title
[FIX] Fix unpickling domains: do not pickle indices that can cause problems
[FIX] Fix unpickling domains: do not pickle indices (which can cause problems)
Jan 26, 2023
markotoplak
force-pushed
the
fix-unpickling-domains
branch
from
January 26, 2023 18:04
53e1948
to
03168a2
Compare
Unpickling dictionaries that include objects that redefine __hash__ as keys is sometimes problematic (when said objects do not have __dict__ filled-in yet in but are used as keys in a restored dictionary).
markotoplak
force-pushed
the
fix-unpickling-domains
branch
from
January 26, 2023 20:02
03168a2
to
7fd4540
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6317 +/- ##
=======================================
Coverage 87.48% 87.48%
=======================================
Files 316 316
Lines 67968 67986 +18
=======================================
+ Hits 59459 59478 +19
+ Misses 8509 8508 -1 |
The previous skipping did not work.
@janezd, falling -latest tests are independent of this PR. |
Ah, you've seen nothing yet. Wait for lazy signals! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #6206, where the domain could not be unpickled if data included something based on SharedComputeValue (that redefined
__hash__
) and was further preprocessed before learning (thus only scikit-based learners failed but TreeLearner did not).Unpickling dictionaries that include objects that redefine
__hash__
as keys is sometimes problematic (when said objects do not have__dict__
filled-in yet in but are used as keys in a restored dictionary).See the following for a problem description. https://petrounias.org/articles/2014/09/16/pickling-python-collections-with-non-built-in-type-keys-and-cycles/
Description of changes
Orange's
Domain
includes_indices
for name-based or var-based indexing. That is a dictionary withVariables
as keys, and these can cause problems during unpickling. Because_indices
can be recreated, I decided not to pickle it and therefore managed to avoid this specific problem.This will makes new pickled domain incompatible with older Orange versions.
Includes