-
Notifications
You must be signed in to change notification settings - Fork 127
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 pickle deserialization of ExperimentData #1326
Conversation
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.
Looks good to me. I'll approve once lint error is resolved.
@nkanazawa1989 I got sidetracked from this for a while.... The reason I had marked this as a draft was that I was not sure about the changes that I made to the test code. The actual code fix is straightforward. I wanted to add a test though to verify the fix and check for future regressions. The test I added runs analysis on an experiment data object, then serializes/deserializes the experiment data through pickle, and runs analysis on the new experiment data object. I wanted to compare the two experiment data objects. I found that a simple comparison of the experiment data object contents would not give equality because results store their creation times as a field. Additionally, every result gets a result ID which is derived from a uuid which is also time-based. These result IDs are generated internally, so really there is no way to generate two experiment data objects with results that are identical. To allow for my test to work, I added a
I decided to always ignore the result IDs (making my second question irrelevant) and do sorting on the table entries. I am open to other suggestions. |
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.
Thanks @wshanks new validation logic seems reasonable.
Previously, `ExperimentData` objects could be serialized and deserialized using Python's `pickle` module, but deserialized objects were not completely restored and an exception would be raised when doing some operations like running analysis on the restored object.
Previously,
ExperimentData
objects could be serialized anddeserialized using Python's
pickle
module, but deserialized objectswere not completely restored and an exception would be raised when doing
some operations like running analysis on the restored object.