Skip to content
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

Call object_from_json from decoder when issubclass(_class, SerializationMixin) #2396

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ax/storage/json_store/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ def object_from_json(
)
elif isclass(_class) and issubclass(_class, SerializationMixin):
return _class(
# Note: we do not recursively call object_from_json here again as
# that would invalidate design principles behind deserialize_init_args.
# Any Ax class that needs serialization and who's init args include
# another Ax class that needs serialization should implement its own
# _to_json and _from_json methods and register them appropriately.
**_class.deserialize_init_args(
args=object_json,
decoder_registry=decoder_registry,
Expand Down