diff --git a/api/constants/position.py b/api/constants/position.py deleted file mode 100644 index 4dfdbaf49a..0000000000 --- a/api/constants/position.py +++ /dev/null @@ -1,3 +0,0 @@ -# Used to mark a position as excluded. -# See api/core/helper/position_helper.py for more details. -POSITION_EXCLUDED = -999 diff --git a/api/core/helper/position_helper.py b/api/core/helper/position_helper.py index b52ae580c8..c73f466a51 100644 --- a/api/core/helper/position_helper.py +++ b/api/core/helper/position_helper.py @@ -76,7 +76,7 @@ def is_filtered( exclude_set: set[str], data: Any, name_func: Callable[[Any], str], -) -> list[Any]: +) -> bool: """ Chcek if the object should be filtered out. :param include_set: the set of names to be included diff --git a/api/core/tools/tool_manager.py b/api/core/tools/tool_manager.py index f99ab25cb2..4a0188af49 100644 --- a/api/core/tools/tool_manager.py +++ b/api/core/tools/tool_manager.py @@ -402,7 +402,7 @@ class ToolManager: db_builtin_providers: list[BuiltinToolProvider] = db.session.query(BuiltinToolProvider). \ filter(BuiltinToolProvider.tenant_id == tenant_id).all() - def find_db_builtin_provider(provider): return next( + find_db_builtin_provider = lambda provider: next( (x for x in db_builtin_providers if x.provider == provider), None ) diff --git a/api/services/tools/builtin_tools_manage_service.py b/api/services/tools/builtin_tools_manage_service.py index 79b07b54ca..ebadbd9be0 100644 --- a/api/services/tools/builtin_tools_manage_service.py +++ b/api/services/tools/builtin_tools_manage_service.py @@ -198,7 +198,7 @@ class BuiltinToolManageService: ).all() or [] # find provider - def find_provider(provider): return next(filter(lambda db_provider: db_provider.provider == provider, db_providers), None) + find_provider = lambda provider: next(filter(lambda db_provider: db_provider.provider == provider, db_providers), None) result: list[UserToolProvider] = []