mirror of
https://github.com/langgenius/dify.git
synced 2025-09-11 18:22:47 +00:00
minor code fix: remove duplicate type check branch (#22536)
This commit is contained in:
parent
e4ae1e2b94
commit
c3037c5491
@ -91,8 +91,6 @@ class SegmentType(StrEnum):
|
|||||||
return SegmentType.OBJECT
|
return SegmentType.OBJECT
|
||||||
elif isinstance(value, File):
|
elif isinstance(value, File):
|
||||||
return SegmentType.FILE
|
return SegmentType.FILE
|
||||||
elif isinstance(value, str):
|
|
||||||
return SegmentType.STRING
|
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -152,7 +152,6 @@ class VariablePool(BaseModel):
|
|||||||
self.variable_dictionary[selector[0]] = {}
|
self.variable_dictionary[selector[0]] = {}
|
||||||
return
|
return
|
||||||
key, hash_key = self._selector_to_keys(selector)
|
key, hash_key = self._selector_to_keys(selector)
|
||||||
hash_key = hash(tuple(selector[1:]))
|
|
||||||
self.variable_dictionary[key].pop(hash_key, None)
|
self.variable_dictionary[key].pop(hash_key, None)
|
||||||
|
|
||||||
def convert_template(self, template: str, /):
|
def convert_template(self, template: str, /):
|
||||||
|
@ -376,7 +376,7 @@ class TestSegmentDumpAndLoad:
|
|||||||
f"get_segment_discriminator failed for serialized form of type {type(variable)}"
|
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
|
# Test invalid cases
|
||||||
assert get_segment_discriminator({"value_type": "invalid"}) is None
|
assert get_segment_discriminator({"value_type": "invalid"}) is None
|
||||||
assert get_segment_discriminator({}) is None
|
assert get_segment_discriminator({}) is None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user