Pārlūkot izejas kodu

test: fix code node

Signed-off-by: -LAN- <laipz8200@outlook.com>
tags/2.0.0-beta.1
-LAN- pirms 1 mēnesi
vecāks
revīzija
9c2943183e
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 7
    1
      api/core/workflow/nodes/code/code_node.py

+ 7
- 1
api/core/workflow/nodes/code/code_node.py Parādīt failu

@@ -255,7 +255,13 @@ class CodeNode(Node):
)
elif output_config.type == SegmentType.NUMBER:
# check if number available
checked = self._check_number(value=result[output_name], variable=f"{prefix}{dot}{output_name}")
value = result.get(output_name)
if not isinstance(value, (int, float, None)):
raise OutputValidationError(
f"Output {prefix}{dot}{output_name} is not a number,"
f" got {type(result.get(output_name))} instead."
)
checked = self._check_number(value=value, variable=f"{prefix}{dot}{output_name}")
# If the output is a boolean and the output schema specifies a NUMBER type,
# convert the boolean value to an integer.
#

Notiek ielāde…
Atcelt
Saglabāt