Skip to content

Commit

Permalink
fix: list filter node some operator raise error (langgenius#9539)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjlarry authored and JunXu01 committed Nov 9, 2024
1 parent a02a89b commit b25fbeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions api/core/workflow/nodes/list_operator/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
_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
"=",
"!=",
"",
"<",
">",
"≥",
Expand Down
8 changes: 4 additions & 4 deletions api/core/workflow/nodes/list_operator/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit b25fbeb

Please sign in to comment.