chore(api): Mark all methods of WorkflowNodeExecutionRepository as abstract

pull/19968/head
QuantumGhost 1 year ago
parent 09c560b9cf
commit cbec89f69e

@ -1,3 +1,4 @@
import abc
from collections.abc import Sequence from collections.abc import Sequence
from dataclasses import dataclass from dataclasses import dataclass
from typing import Literal, Optional, Protocol from typing import Literal, Optional, Protocol
@ -26,6 +27,7 @@ class WorkflowNodeExecutionRepository(Protocol):
application domains or deployment scenarios. application domains or deployment scenarios.
""" """
@abc.abstractmethod
def save(self, execution: NodeExecution) -> None: def save(self, execution: NodeExecution) -> None:
""" """
Save or update a NodeExecution instance. 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]: def get_by_node_execution_id(self, node_execution_id: str) -> Optional[NodeExecution]:
""" """
Retrieve a NodeExecution by its node_execution_id. Retrieve a NodeExecution by its node_execution_id.
@ -51,6 +54,7 @@ class WorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abc.abstractmethod
def get_by_workflow_run( def get_by_workflow_run(
self, self,
workflow_run_id: str, workflow_run_id: str,
@ -70,6 +74,7 @@ class WorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abc.abstractmethod
def get_running_executions(self, workflow_run_id: str) -> Sequence[NodeExecution]: def get_running_executions(self, workflow_run_id: str) -> Sequence[NodeExecution]:
""" """
Retrieve all running NodeExecution instances for a specific workflow run. Retrieve all running NodeExecution instances for a specific workflow run.
@ -82,6 +87,7 @@ class WorkflowNodeExecutionRepository(Protocol):
""" """
... ...
@abc.abstractmethod
def clear(self) -> None: def clear(self) -> None:
""" """
Clear all NodeExecution records based on implementation-specific criteria. Clear all NodeExecution records based on implementation-specific criteria.

@ -7,6 +7,7 @@ from sqlalchemy import func
from sqlalchemy.orm import Mapped, Session, mapped_column from sqlalchemy.orm import Mapped, Session, mapped_column
from models.base import Base from models.base import Base
from .engine import db from .engine import db
from .types import StringUUID from .types import StringUUID

Loading…
Cancel
Save