You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I pickle the diff and then unpickle and try to subtract delta created from diff, I get error. I added prinst statements to your code starting at 'Line 571 of delta.py'.
Hi @dlarosa11
Thanks for reporting the bug. I will take a look when I have a chance!
PRs are always very welcome too. Also please include which version of DeepDiff you are using.
It seems the issue is that DeepDiff.from_json_pickle returns a dict and not a DeepDiff. I don't know how to turn the dict back into a DeepDiff with all the information it had before pickling.
Test code:
from deepdiff import DeepDiff, Delta
t1 = {1: "one"}
t2 = {1: "one", 2: "two"}
diff_before = DeepDiff(t1, t2)
print(f"diff type before pickle: {type(diff_before)}")
jsoned = diff_before.to_json_pickle()
diff = DeepDiff.from_json_pickle(jsoned)
print(f"diff type after depickle: {type(diff)} {diff}")
Output:
diff type before pickle: <class 'deepdiff.diff.DeepDiff'>
diff type after depickle: <class 'dict'> {'dictionary_item_added': ['root[2]']}
When I pickle the diff and then unpickle and try to subtract delta created from diff, I get error. I added prinst statements to your code starting at 'Line 571 of delta.py'.
Code:
Output
The text was updated successfully, but these errors were encountered: