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.

minor code fix: remove duplicate type check branch (#22536)

NeatGuyCodingc3037c5491ce
diff --git a/api/core/variables/types.py b/api/core/variables/types.py
index e39237dba51..e79b2410bfa 100644
--- a/api/core/variables/types.py
+++ b/api/core/variables/types.py
@@ -91,8 +91,6 @@ class SegmentType(StrEnum):
return SegmentType.OBJECT
elif isinstance(value, File):
return SegmentType.FILE
- elif isinstance(value, str):
- return SegmentType.STRING
else:
return None
diff --git a/api/core/workflow/entities/variable_pool.py b/api/core/workflow/entities/variable_pool.py
index 646a9d34024..fbb8df6b016 100644
--- a/api/core/workflow/entities/variable_pool.py
+++ b/api/core/workflow/entities/variable_pool.py
@@ -152,7 +152,6 @@ class VariablePool(BaseModel):
self.variable_dictionary[selector[0]] = {}
return
key, hash_key = self._selector_to_keys(selector)
- hash_key = hash(tuple(selector[1:]))
self.variable_dictionary[key].pop(hash_key, None)
def convert_template(self, template: str, /):
diff --git a/api/tests/unit_tests/core/variables/test_segment.py b/api/tests/unit_tests/core/variables/test_segment.py
index cdc261fd42c..4c8d983d205 100644
--- a/api/tests/unit_tests/core/variables/test_segment.py
+++ b/api/tests/unit_tests/core/variables/test_segment.py
@@ -376,7 +376,7 @@ class TestSegmentDumpAndLoad:
f"get_segment_discriminator failed for serialized form of type {type(variable)}"
)
- def test_invlaid_value_for_discriminator(self):
+ def test_invalid_value_for_discriminator(self):
# Test invalid cases
assert get_segment_discriminator({"value_type": "invalid"}) is None
assert get_segment_discriminator({}) is None