Skip to content

Commit

Permalink
fix/array file cannot use in iteration node (#12035)
Browse files Browse the repository at this point in the history
Signed-off-by: -LAN- <laipz8200@outlook.com>
  • Loading branch information
laipz8200 authored Dec 24, 2024
1 parent 82134a1 commit 0943437
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/core/variables/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ class FileVariable(FileSegment, Variable):
pass


class ArrayFileVariable(ArrayFileSegment, Variable):
class ArrayFileVariable(ArrayFileSegment, ArrayVariable):
pass
7 changes: 7 additions & 0 deletions api/tests/unit_tests/core/app/segments/test_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from pydantic import ValidationError

from core.variables import (
ArrayFileVariable,
ArrayVariable,
FloatVariable,
IntegerVariable,
ObjectVariable,
Expand Down Expand Up @@ -81,3 +83,8 @@ def test_variable_to_object():
assert var.to_object() == 3.14
var = SecretVariable(name="secret", value="secret_value")
assert var.to_object() == "secret_value"


def test_array_file_variable_is_array_variable():
var = ArrayFileVariable(name="files", value=[])
assert isinstance(var, ArrayVariable)

0 comments on commit 0943437

Please sign in to comment.