https://github.com/apache/airflow/blob/main/airflow/cli/commands/task_command.py#L145
f"run_id or execution_date of {exec_date_or_run_id!r} not found"
            )
        
        ti = TaskInstance(task, run_id=dag_run.run_id, map_index=map_index)
        ti.dag_run = dag_run
    else:
        ti = ti_or_none
    ti.refresh_from_task(task, pool_override=pool)
    return ti, dr_created
def _run_task_by_selected_method(args, dag: DAG, ti: TaskInstance) -> None | TaskReturnCode:
    """
    Run the task based on a mode.
    Any of the 3 modes are available:
    - using LocalTaskJob
    - as raw task
    - by executor
    """
    if args.local:
        return _run_task_by_local_task_job(args, ti)
    if args.raw:
        return _run_raw_task(args, ti)
    _run_task_by_executor(args, dag, ti)
    return None
def _run_task_by_executor(args, dag: DAG, ti: TaskInstance) -> None:
    """
    Send the task to the executor for execution.
    This can result in the task being started by another host if the executor implementation does.
    """
    pickle_id = None
    if args.ship_dag: