Skip to content

Commit

Permalink
Fix deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza committed Aug 20, 2024
1 parent a9bf993 commit 4c6d8f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hayhooks/server/pipelines/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ def convert_component_output(component_output):
for output_name, data in component_output.items():

def get_value(data):
return data.to_dict()["init_parameters"] if hasattr(data, "to_dict") else data
if hasattr(data, "to_dict") and "init_parameters" in data.to_dict():
return data.to_dict()["init_parameters"]
elif hasattr(data, "to_dict"):
return data.to_dict()
else:
return data

if type(data) is list:
result[output_name] = [get_value(d) for d in data]
Expand Down

0 comments on commit 4c6d8f3

Please sign in to comment.