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

Fix JSON Serialization for Custom Objects in Lists and Dicts #2930

Closed
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
2 changes: 1 addition & 1 deletion flytekit/interaction/click_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def _parse(self, value: typing.Any, param: typing.Optional[click.Parameter]):
if type(value) == dict or type(value) == list:
return value
try:
return json.loads(value)
return json.loads(json.dumps(value, default=lambda o: o.__dict__))
except Exception: # noqa
try:
# We failed to load the json, so we'll try to load it as a file
Expand Down