task_dao
CheckMate task data access object (DAO) for the EleanorAI Framework backend.
Note
CheckMate tasks are global to the entire framework and are not considered namespaced resources.
Attributes
Classes
TaskDao
Bases: BaseDao
Task data access object (DAO)
Attributes
Functions
get_cleanable_tasks
get_cleanable_tasks() -> List[Task]
Retrieve tasks that are candidates for cleanup.
Returns:
-
List[Task]
–List[Task]: A list of tasks that are not cleaned and are in an inactive state.
Examples:
get_filtered_tasks
get_filtered_tasks(
cleaned: bool | None = None,
status: (
Union[StageStatus, List[StageStatus]] | None
) = None,
since: datetime | None = None,
sort: str = "asc",
max_results: int | None = None,
queue: str | None = None,
tags: List[str] | None = None,
) -> list[Task]
Retrieve tasks from the database based on provided filters.
Parameters:
-
cleaned
(bool | None
, default:None
) –Filter tasks based on whether they are cleaned.
-
status
(Union[StageStatus, List[StageStatus]] | None
, default:None
) –Filter tasks based on their status.
-
since
(datetime | None
, default:None
) –Filter tasks created or updated since this datetime.
-
sort
(str
, default:'asc'
) –Sort order of the results by
update_ts
. -
max_results
(int | None
, default:None
) –Maximum number of results to return.
-
queue
(str | None
, default:None
) –Filter tasks based on their queue.
Returns:
-
list[Task]
–list[Task]: A list of tasks matching the provided filters.
Examples:
get_tasks_by_pkids
get_tasks_by_pkids(task_ids: List[str]) -> list[Task]
Retrieve tasks from the database based on their primary key identifiers.
Parameters:
-
task_ids
(List[str]
) –A list of task primary key identifiers.
Returns:
-
list[Task]
–list[Task]: A list of tasks matching the provided identifiers.
Examples: