Skip to content

Commit

Permalink
Fix/code transform result (#3203)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Apr 9, 2024
1 parent bae0c07 commit 337899a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/core/workflow/nodes/code/code_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ def _transform_result(self, result: dict, output_schema: Optional[dict[str, Code
parameters_validated = {}
for output_name, output_config in output_schema.items():
dot = '.' if prefix else ''
if output_name not in result:
raise ValueError(f'Output {prefix}{dot}{output_name} is missing.')

if output_config.type == 'object':
# check if output is object
if not isinstance(result.get(output_name), dict):
Expand Down

0 comments on commit 337899a

Please sign in to comment.