소스 검색

fix(api): fix incorrectly handling of `array[boolean]` constant in loop node (#24619)

tags/1.8.0
QuantumGhost 2 달 전
부모
커밋
421a3284bc
No account linked to committer's email address
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4
    1
      api/core/workflow/nodes/loop/loop_node.py

+ 4
- 1
api/core/workflow/nodes/loop/loop_node.py 파일 보기

@@ -524,7 +524,10 @@ class LoopNode(BaseNode):
@staticmethod
def _get_segment_for_constant(var_type: SegmentType, original_value: Any) -> Segment:
"""Get the appropriate segment type for a constant value."""
if not var_type.is_array_type() or var_type == SegmentType.BOOLEAN:
# TODO: Refactor for maintainability:
# 1. Ensure type handling logic stays synchronized with _VALID_VAR_TYPE (entities.py)
# 2. Consider moving this method to LoopVariableData class for better encapsulation
if not var_type.is_array_type() or var_type == SegmentType.ARRAY_BOOLEAN:
value = original_value
elif var_type in [
SegmentType.ARRAY_NUMBER,

Loading…
취소
저장