https://github.com/apache/airflow/blob/main/airflow/cli/commands/task_command.py#L145
from airflow.utils.sqlalchemy import UtcDateTime, nulls_first, skip_locked, tuple_in_condition, with_row_locks
from airflow.utils.state import DagRunState, State, TaskInstanceState
from airflow.utils.types import NOTSET, DagRunType
if TYPE_CHECKING:
    from datetime import datetime
    from sqlalchemy.orm import Query, Session
    from airflow.models.dag import DAG
    from airflow.models.operator import Operator
    from airflow.serialization.pydantic.dag_run import DagRunPydantic
    from airflow.typing_compat import Literal
    from airflow.utils.types import ArgNotSet
    CreatedTasks = TypeVar("CreatedTasks", Iterator["dict[str, Any]"], Iterator[TI])
    TaskCreator = Callable[[Operator, Iterable[int]], CreatedTasks]
RUN_ID_REGEX = r"^(?:manual|scheduled|dataset_triggered)__(?:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+00:00)$"
class TISchedulingDecision(NamedTuple):
    """Type of return for DagRun.task_instance_scheduling_decisions."""
    tis: list[TI]
    schedulable_tis: list[TI]
    changed_tis: bool
    unfinished_tis: list[TI]
    finished_tis: list[TI]
def _creator_note(val):
    """Creator the ``note`` association proxy."""
    if isinstance(val, str):
        return DagRunNote(content=val)
    elif isinstance(val, dict):
        return DagRunNote(**val)
    else:
        return DagRunNote(*val)
class DagRun(Base, LoggingMixin):