Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: value_type check failed when updating variables (#24274)

me01060e1dfb4161b7
diff --git a/api/core/variables/types.py b/api/core/variables/types.py
index d28fb11401a..66290560429 100644
--- a/api/core/variables/types.py
+++ b/api/core/variables/types.py
@@ -126,7 +126,7 @@ class SegmentType(StrEnum):
"""
if self.is_array_type():
return self._validate_array(value, array_validation)
- elif self == SegmentType.NUMBER:
+ elif self in [SegmentType.INTEGER, SegmentType.FLOAT, SegmentType.NUMBER]:
return isinstance(value, (int, float))
elif self == SegmentType.STRING:
return isinstance(value, str)
@@ -166,7 +166,6 @@ _ARRAY_TYPES = frozenset(
]
)
-
_NUMERICAL_TYPES = frozenset(
[
SegmentType.NUMBER,