prefect.server.models.task_runs
Functions for interacting with task run ORM objects.
Intended for internal use by the Prefect REST API.
Functions
create_task_run
session
: a database sessiontask_run
: a task run model
- orm_models.TaskRun: the newly-created or existing task run
update_task_run
session
: a database sessiontask_run_id
: the task run id to updatetask_run
: a task run model
- whether or not matching rows were found to update
read_task_run
session
: a database sessiontask_run_id
: the task run id
- orm_models.TaskRun: the task run
read_task_run_with_flow_run_name
session
: a database sessiontask_run_id
: the task run id
- orm_models.TaskRun: the task run with the flow run name
read_task_runs
session
: a database sessionflow_filter
: only select task runs whose flows match these filtersflow_run_filter
: only select task runs whose flow runs match these filterstask_run_filter
: only select task runs that match these filtersdeployment_filter
: only select task runs whose deployments match these filtersoffset
: Query offsetlimit
: Query limitsort
: Query sort
- List[orm_models.TaskRun]: the task runs
count_task_runs
session
: a database sessionflow_filter
: only count task runs whose flows match these filtersflow_run_filter
: only count task runs whose flow runs match these filterstask_run_filter
: only count task runs that match these filtersdeployment_filter
: only count task runs whose deployments match these filters
count_task_runs_by_state
session
: a database sessionflow_filter
: only count task runs whose flows match these filtersflow_run_filter
: only count task runs whose flow runs match these filterstask_run_filter
: only count task runs that match these filtersdeployment_filter
: only count task runs whose deployments match these filters
delete_task_run
session
: a database sessiontask_run_id
: the task run id to delete
- whether or not the task run was deleted
set_task_run_state
state
input. If
the state is considered valid, it will be written to the database. Otherwise, a
it’s possible a different state, or no state, will be created. A force
flag is
supplied to bypass a subset of orchestration logic.
Args:
session
: a database sessiontask_run_id
: the task run idstate
: a task run state modelforce
: if False, orchestration rules will be applied that may alter or prevent the state transition. If True, orchestration rules are not applied.
- OrchestrationResult object