From cbec89f69ee3209236576859c9b5171f9a2c62d0 Mon Sep 17 00:00:00 2001 From: QuantumGhost Date: Tue, 20 May 2025 14:30:22 +0800 Subject: [PATCH] chore(api): Mark all methods of WorkflowNodeExecutionRepository as abstract --- .../repository/workflow_node_execution_repository.py | 6 ++++++ api/models/account.py | 1 + 2 files changed, 7 insertions(+) diff --git a/api/core/workflow/repository/workflow_node_execution_repository.py b/api/core/workflow/repository/workflow_node_execution_repository.py index 3ca9e2ecab..fe8f4ecf6d 100644 --- a/api/core/workflow/repository/workflow_node_execution_repository.py +++ b/api/core/workflow/repository/workflow_node_execution_repository.py @@ -1,3 +1,4 @@ +import abc from collections.abc import Sequence from dataclasses import dataclass from typing import Literal, Optional, Protocol @@ -26,6 +27,7 @@ class WorkflowNodeExecutionRepository(Protocol): application domains or deployment scenarios. """ + @abc.abstractmethod def save(self, execution: NodeExecution) -> None: """ Save or update a NodeExecution instance. @@ -39,6 +41,7 @@ class WorkflowNodeExecutionRepository(Protocol): """ ... + @abc.abstractmethod def get_by_node_execution_id(self, node_execution_id: str) -> Optional[NodeExecution]: """ Retrieve a NodeExecution by its node_execution_id. @@ -51,6 +54,7 @@ class WorkflowNodeExecutionRepository(Protocol): """ ... + @abc.abstractmethod def get_by_workflow_run( self, workflow_run_id: str, @@ -70,6 +74,7 @@ class WorkflowNodeExecutionRepository(Protocol): """ ... + @abc.abstractmethod def get_running_executions(self, workflow_run_id: str) -> Sequence[NodeExecution]: """ Retrieve all running NodeExecution instances for a specific workflow run. @@ -82,6 +87,7 @@ class WorkflowNodeExecutionRepository(Protocol): """ ... + @abc.abstractmethod def clear(self) -> None: """ Clear all NodeExecution records based on implementation-specific criteria. diff --git a/api/models/account.py b/api/models/account.py index 9ace8c59f4..8630b36a92 100644 --- a/api/models/account.py +++ b/api/models/account.py @@ -7,6 +7,7 @@ from sqlalchemy import func from sqlalchemy.orm import Mapped, Session, mapped_column from models.base import Base + from .engine import db from .types import StringUUID