-
Notifications
You must be signed in to change notification settings - Fork 63
[BUG] serializable
decorator produces wrong package for serialization
#451
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I think we have 3 options here: 1.
|
Thanks for listing them explicitly. As all have pros and cons, I think it comes down to priorities, which are a bit ambiguous. I think for me the order (for somewhat arbitrary priorities) is:
This is why I'm in favor of option 3. Is this something you could get behind? Or is there an aspect missing or something you would prioritize differently? |
It will be 30 minutes of work to manually provide package names, so I am definitely not against 3. |
To Reproduce
On
dev
ormain
, runOutput:
Expected behavior
The path should be the path to the module, so
Solution
In
utils.serialization.serializable
, increase thedepth
in thesys._getframe
call to2
.Additional context
I came across this for #449 and #450, and first assumed my changes to the allow_args decorator had caused it, so I already fixed it in a1b4d19, which is included in those PRs. Upon further testing, I noticed the problem already existed in
dev
andmain
.The fix will break loading of serialized files created while the bug was present, but I think fixing it quickly and putting out an update is probably the best way forward. We might want to combine this with the deprecation of our old serialization helper functions in #450.
I think we should reflect on whether we want to keep the functionality of
serializable
like this. In my opinion, it brings a certain fragility, because moving classes to a different file or folder breaks deserialization, even when the class itself did not change. Requiringpackage
to be set manually will remove this footgun, and thereby remove one cause for accidentally breaking serializability.The text was updated successfully, but these errors were encountered: