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
I'm trying to load a supposedly correctly dumped object of the following custom class that stores alternative names of keys from main dict as a dict where keys are aliases and values are lists of corresponding keys from main dict:
Traceback (most recent call last):
File "C:\Users\Maciej\mirna-page\page.py", line 11, in <module>
db = read_db("mirna_table.pkl")
File "C:\Users\Maciej\mirna-page\table_parser.py", line 39, in read_db
return dill.load(f)
File "C:\Users\Maciej\AppData\Local\Programs\Python\Python310\lib\site-packages\dill\_dill.py", line 287, in load
return Unpickler(file, ignore=ignore, **kwds).load()
File "C:\Users\Maciej\AppData\Local\Programs\Python\Python310\lib\site-packages\dill\_dill.py", line 442, in load
obj = StockUnpickler.load(self)
File "C:\Users\Maciej\mirna-page\utils.py", line 46, in __setitem__
return super().__setitem__(self.aliases.get(key, key), value)
AttributeError: 'AliasedDict' object has no attribute 'aliases'
Seems like dill does not serialize aliases, which is true if I try to serialize object with json - only dict is serialized, no trace of aliases. Why is that a case?
If not serialized, everything works fine.
dill version 0.3.7
Python 3.10.6
Windows 10
The text was updated successfully, but these errors were encountered:
I also get this error when trying to deserialize instances of classes which inherit from other classes. I'm wondering if it's an issue that specifically affects inherited classes.
I'm trying to load a supposedly correctly dumped object of the following custom class that stores alternative names of keys from main dict as a dict where keys are aliases and values are lists of corresponding keys from main dict:
utils.py:
table_parser.py:
This produces an error:
Seems like dill does not serialize aliases, which is true if I try to serialize object with json - only dict is serialized, no trace of aliases. Why is that a case?
If not serialized, everything works fine.
dill version 0.3.7
Python 3.10.6
Windows 10
The text was updated successfully, but these errors were encountered: