From 909259da373acac172cd66875613cba46e4116c5 Mon Sep 17 00:00:00 2001 From: yihong Date: Mon, 16 Jun 2025 12:07:41 +0800 Subject: [PATCH] fix: delete some dead code using vulture (#20999) Signed-off-by: yihong0618 --- api/core/workflow/nodes/event/event.py | 9 --------- api/factories/variable_factory.py | 4 ---- api/services/errors/__init__.py | 2 -- api/services/errors/account.py | 4 ---- api/services/errors/completion.py | 5 ----- 5 files changed, 24 deletions(-) delete mode 100644 api/services/errors/completion.py diff --git a/api/core/workflow/nodes/event/event.py b/api/core/workflow/nodes/event/event.py index b72d111f4..3ebe80f24 100644 --- a/api/core/workflow/nodes/event/event.py +++ b/api/core/workflow/nodes/event/event.py @@ -6,7 +6,6 @@ from pydantic import BaseModel, Field from core.model_runtime.entities.llm_entities import LLMUsage from core.rag.entities.citation_metadata import RetrievalSourceMetadata from core.workflow.entities.node_entities import NodeRunResult -from core.workflow.entities.workflow_node_execution import WorkflowNodeExecutionStatus class RunCompletedEvent(BaseModel): @@ -39,11 +38,3 @@ class RunRetryEvent(BaseModel): error: str = Field(..., description="error") retry_index: int = Field(..., description="Retry attempt number") start_at: datetime = Field(..., description="Retry start time") - - -class SingleStepRetryEvent(NodeRunResult): - """Single step retry event""" - - status: WorkflowNodeExecutionStatus = WorkflowNodeExecutionStatus.RETRY - - elapsed_time: float = Field(..., description="elapsed time") diff --git a/api/factories/variable_factory.py b/api/factories/variable_factory.py index fa8a90e79..a41ef4ae4 100644 --- a/api/factories/variable_factory.py +++ b/api/factories/variable_factory.py @@ -39,10 +39,6 @@ from core.variables.variables import ( from core.workflow.constants import CONVERSATION_VARIABLE_NODE_ID, ENVIRONMENT_VARIABLE_NODE_ID -class InvalidSelectorError(ValueError): - pass - - class UnsupportedSegmentTypeError(Exception): pass diff --git a/api/services/errors/__init__.py b/api/services/errors/__init__.py index eb1f05570..697e69122 100644 --- a/api/services/errors/__init__.py +++ b/api/services/errors/__init__.py @@ -4,7 +4,6 @@ from . import ( app_model_config, audio, base, - completion, conversation, dataset, document, @@ -19,7 +18,6 @@ __all__ = [ "app_model_config", "audio", "base", - "completion", "conversation", "dataset", "document", diff --git a/api/services/errors/account.py b/api/services/errors/account.py index 5aca12ffe..4d3d150e0 100644 --- a/api/services/errors/account.py +++ b/api/services/errors/account.py @@ -55,7 +55,3 @@ class MemberNotInTenantError(BaseServiceError): class RoleAlreadyAssignedError(BaseServiceError): pass - - -class RateLimitExceededError(BaseServiceError): - pass diff --git a/api/services/errors/completion.py b/api/services/errors/completion.py deleted file mode 100644 index 7fc50a588..000000000 --- a/api/services/errors/completion.py +++ /dev/null @@ -1,5 +0,0 @@ -from services.errors.base import BaseServiceError - - -class CompletionStoppedError(BaseServiceError): - pass