Skip to content

Commit

Permalink
fixed: code_node is not compatible with previous versions
Browse files Browse the repository at this point in the history
  • Loading branch information
hobo-l-20230331 committed Nov 4, 2024
1 parent 971defb commit 4885342
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions api/core/workflow/nodes/code/code_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,9 @@ def _run(self) -> NodeRunResult:
variables = {}
for variable_selector in self.node_data.variables:
variable_name = variable_selector.variable
variable = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector)
if variable is None:
return NodeRunResult(
status=WorkflowNodeExecutionStatus.FAILED,
inputs=variables,
error=f"Variable `{variable_selector.value_selector}` not found",
)
variables[variable_name] = variable.to_object()
variable = self.graph_runtime_state.variable_pool.get_any(variable_selector.value_selector)

variables[variable_name] = variable
# Run code
try:
result = CodeExecutor.execute_workflow_code_template(
Expand Down

0 comments on commit 4885342

Please sign in to comment.