Skip to content

Commit 421a328

Browse files
authored
fix(api): fix incorrectly handling of array[boolean] constant in loop node (#24619)
1 parent d488325 commit 421a328

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/core/workflow/nodes/loop/loop_node.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,10 @@ def _extract_variable_selector_to_variable_mapping(
524524
@staticmethod
525525
def _get_segment_for_constant(var_type: SegmentType, original_value: Any) -> Segment:
526526
"""Get the appropriate segment type for a constant value."""
527-
if not var_type.is_array_type() or var_type == SegmentType.BOOLEAN:
527+
# TODO: Refactor for maintainability:
528+
# 1. Ensure type handling logic stays synchronized with _VALID_VAR_TYPE (entities.py)
529+
# 2. Consider moving this method to LoopVariableData class for better encapsulation
530+
if not var_type.is_array_type() or var_type == SegmentType.ARRAY_BOOLEAN:
528531
value = original_value
529532
elif var_type in [
530533
SegmentType.ARRAY_NUMBER,

0 commit comments

Comments
 (0)