From f762c969b3d07671480c11da098b78a83de1d382 Mon Sep 17 00:00:00 2001 From: QuantumGhost Date: Tue, 26 Aug 2025 12:44:25 +0800 Subject: [PATCH] chore(api): resolve MyPy issues --- api/core/workflow/nodes/loop/loop_node.py | 2 +- api/core/workflow/utils/condition/processor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/workflow/nodes/loop/loop_node.py b/api/core/workflow/nodes/loop/loop_node.py index df576220f4..3e52a32182 100644 --- a/api/core/workflow/nodes/loop/loop_node.py +++ b/api/core/workflow/nodes/loop/loop_node.py @@ -404,7 +404,7 @@ class LoopNode(BaseNode): for node_id in loop_graph.node_ids: variable_pool.remove([node_id]) - _outputs = {} + _outputs: dict[str, Segment | int | None] = {} for loop_variable_key, loop_variable_selector in loop_variable_selectors.items(): _loop_variable_segment = variable_pool.get(loop_variable_selector) if _loop_variable_segment: diff --git a/api/core/workflow/utils/condition/processor.py b/api/core/workflow/utils/condition/processor.py index 6554e4c396..7efd1acbf1 100644 --- a/api/core/workflow/utils/condition/processor.py +++ b/api/core/workflow/utils/condition/processor.py @@ -62,7 +62,7 @@ class ConditionProcessor: ) else: actual_value = variable.value if variable else None - expected_value = condition.value + expected_value: str | Sequence[str] | bool | list[bool] | None = condition.value if isinstance(expected_value, str): expected_value = variable_pool.convert_template(expected_value).text # Here we need to explicit convet the input string to boolean.