mirror of
https://github.com/langgenius/dify.git
synced 2026-04-24 09:06:42 +08:00
fix: list filter node some operator raise error (#9539)
This commit is contained in:
parent
53b14bde4d
commit
f83ed19dfe
@ -8,18 +8,18 @@ from core.workflow.nodes.base import BaseNodeData
|
|||||||
_Condition = Literal[
|
_Condition = Literal[
|
||||||
# string conditions
|
# string conditions
|
||||||
"contains",
|
"contains",
|
||||||
"startswith",
|
"start with",
|
||||||
"endswith",
|
"end with",
|
||||||
"is",
|
"is",
|
||||||
"in",
|
"in",
|
||||||
"empty",
|
"empty",
|
||||||
"not contains",
|
"not contains",
|
||||||
"not is",
|
"is not",
|
||||||
"not in",
|
"not in",
|
||||||
"not empty",
|
"not empty",
|
||||||
# number conditions
|
# number conditions
|
||||||
"=",
|
"=",
|
||||||
"!=",
|
"≠",
|
||||||
"<",
|
"<",
|
||||||
">",
|
">",
|
||||||
"≥",
|
"≥",
|
||||||
|
|||||||
@ -132,9 +132,9 @@ def _get_string_filter_func(*, condition: str, value: str) -> Callable[[str], bo
|
|||||||
match condition:
|
match condition:
|
||||||
case "contains":
|
case "contains":
|
||||||
return _contains(value)
|
return _contains(value)
|
||||||
case "startswith":
|
case "start with":
|
||||||
return _startswith(value)
|
return _startswith(value)
|
||||||
case "endswith":
|
case "end with":
|
||||||
return _endswith(value)
|
return _endswith(value)
|
||||||
case "is":
|
case "is":
|
||||||
return _is(value)
|
return _is(value)
|
||||||
@ -144,7 +144,7 @@ def _get_string_filter_func(*, condition: str, value: str) -> Callable[[str], bo
|
|||||||
return lambda x: x == ""
|
return lambda x: x == ""
|
||||||
case "not contains":
|
case "not contains":
|
||||||
return lambda x: not _contains(value)(x)
|
return lambda x: not _contains(value)(x)
|
||||||
case "not is":
|
case "is not":
|
||||||
return lambda x: not _is(value)(x)
|
return lambda x: not _is(value)(x)
|
||||||
case "not in":
|
case "not in":
|
||||||
return lambda x: not _in(value)(x)
|
return lambda x: not _in(value)(x)
|
||||||
@ -168,7 +168,7 @@ def _get_number_filter_func(*, condition: str, value: int | float) -> Callable[[
|
|||||||
match condition:
|
match condition:
|
||||||
case "=":
|
case "=":
|
||||||
return _eq(value)
|
return _eq(value)
|
||||||
case "!=":
|
case "≠":
|
||||||
return _ne(value)
|
return _ne(value)
|
||||||
case "<":
|
case "<":
|
||||||
return _lt(value)
|
return _lt(value)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user