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: list filter node some operator raise error (#9539)

非法操作f83ed19dfe14
diff --git a/api/core/workflow/nodes/list_operator/entities.py b/api/core/workflow/nodes/list_operator/entities.py
index b4c885fb3df..79cef1c27ab 100644
--- a/api/core/workflow/nodes/list_operator/entities.py
+++ b/api/core/workflow/nodes/list_operator/entities.py
@@ -8,18 +8,18 @@ from core.workflow.nodes.base import BaseNodeData
_Condition = Literal[
# string conditions
"contains",
- "startswith",
- "endswith",
+ "start with",
+ "end with",
"is",
"in",
"empty",
"not contains",
- "not is",
+ "is not",
"not in",
"not empty",
# number conditions
"=",
- "!=",
+ "≠",
"<",
">",
"≥",
diff --git a/api/core/workflow/nodes/list_operator/node.py b/api/core/workflow/nodes/list_operator/node.py
index d48e83bb54a..d7e4c64313c 100644
--- a/api/core/workflow/nodes/list_operator/node.py
+++ b/api/core/workflow/nodes/list_operator/node.py
@@ -132,9 +132,9 @@ def _get_string_filter_func(*, condition: str, value: str) -> Callable[[str], bo
match condition:
case "contains":
return _contains(value)
- case "startswith":
+ case "start with":
return _startswith(value)
- case "endswith":
+ case "end with":
return _endswith(value)
case "is":
return _is(value)
@@ -144,7 +144,7 @@ def _get_string_filter_func(*, condition: str, value: str) -> Callable[[str], bo
return lambda x: x == ""
case "not contains":
return lambda x: not _contains(value)(x)
- case "not is":
+ case "is not":
return lambda x: not _is(value)(x)
case "not in":
return lambda x: not _in(value)(x)
@@ -168,7 +168,7 @@ def _get_number_filter_func(*, condition: str, value: int | float) -> Callable[[
match condition:
case "=":
return _eq(value)
- case "!=":
+ case "≠":
return _ne(value)
case "<":
return _lt(value)