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
Regression from 0.3.5.1 to 0.3.6 - serialization of static methods in locally imported classes #572
Comments
Confirmed. |
@mmckerns I think that the new functionality is correct and the old result was wrong. I think in 0.3.6, one of the PRs that I opened changed function lookup from using I guess for this particular case (huggingface/datasets#3297), you can set def mapping_func():
def mapping_func_inst(examples):
ID_LENGTH = 4
examples["id"] = [id_[:ID_LENGTH] for id_ in examples["id"]]
return examples
return mapping_func_inst
squad.map(mapping_func(), batched=True) |
Description
In 0.3.5.1, it was possible to serialize static methods of imported classes.
In 0.3.6, that is no longer the case and the serialization is done only for the reference.
Steps to reproduce
Create files main.py and other_file.py:
python main.py
.other_file.py
(for example tonumber = 2
).python main.py
againWith
dill==0.3.5.1
, the output is different between the two runs, while indill==0.3.6
the output is the same.The text was updated successfully, but these errors were encountered: