refactor(variables): replace deprecated 'get_any' with 'get' method (#9584)
This commit is contained in:
parent
5838345f48
commit
8f670f31b8
8 changed files with 95 additions and 77 deletions
|
|
@ -41,10 +41,15 @@ class CodeNode(BaseNode[CodeNodeData]):
|
|||
# Get variables
|
||||
variables = {}
|
||||
for variable_selector in self.node_data.variables:
|
||||
variable = variable_selector.variable
|
||||
value = self.graph_runtime_state.variable_pool.get_any(variable_selector.value_selector)
|
||||
|
||||
variables[variable] = value
|
||||
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()
|
||||
# Run code
|
||||
try:
|
||||
result = CodeExecutor.execute_workflow_code_template(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue