From 58010f475e9bd41e8d2001c438202fec5c1d52d9 Mon Sep 17 00:00:00 2001 From: Yash Jain <23dec512@lnmiit.ac.in> Date: Fri, 3 Jul 2026 01:50:36 +0530 Subject: [PATCH] Mark tasks CLI commands as migrated to airflowctl --- airflow-core/src/airflow/cli/commands/task_command.py | 7 ++++++- .../tests/unit/cli/commands/test_command_deprecations.py | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/cli/commands/task_command.py b/airflow-core/src/airflow/cli/commands/task_command.py index af944526184b0..8d27e58a88569 100644 --- a/airflow-core/src/airflow/cli/commands/task_command.py +++ b/airflow-core/src/airflow/cli/commands/task_command.py @@ -30,7 +30,7 @@ from airflow import settings from airflow._shared.timezones import timezone from airflow.cli.simple_table import AirflowConsole -from airflow.cli.utils import fetch_dag_run_from_run_id_or_logical_date_string +from airflow.cli.utils import deprecated_for_airflowctl, fetch_dag_run_from_run_id_or_logical_date_string from airflow.exceptions import AirflowConfigException, DagRunNotFound, NotMapped, TaskInstanceNotFound from airflow.models import TaskInstance from airflow.models.dag_version import DagVersion @@ -262,6 +262,7 @@ class TaskCommandMarker: """Marker for listener hooks, to properly detect from which component they are called.""" +@deprecated_for_airflowctl("airflowctl tasks failed-deps") @cli_utils.action_cli(check_db=False) @providers_configuration_loaded def task_failed_deps(args) -> None: @@ -290,6 +291,7 @@ def task_failed_deps(args) -> None: print("Task instance dependencies are all met.") +@deprecated_for_airflowctl("airflowctl tasks state") @cli_utils.action_cli(check_db=False) @suppress_logs_and_warning @providers_configuration_loaded @@ -307,6 +309,7 @@ def task_state(args) -> None: print(ti.state) +@deprecated_for_airflowctl("airflowctl tasks list") @cli_utils.action_cli(check_db=False) @suppress_logs_and_warning @providers_configuration_loaded @@ -354,6 +357,7 @@ def _guess_debugger() -> _SupportedDebugger: raise exc +@deprecated_for_airflowctl("airflowctl tasks states-for-dag-run") @cli_utils.action_cli(check_db=False) @suppress_logs_and_warning @providers_configuration_loaded @@ -492,6 +496,7 @@ def task_render(args, dag: DAG | None = None) -> None: ) +@deprecated_for_airflowctl("airflowctl tasks clear") @cli_utils.action_cli(check_db=False) @providers_configuration_loaded def task_clear(args) -> None: diff --git a/airflow-core/tests/unit/cli/commands/test_command_deprecations.py b/airflow-core/tests/unit/cli/commands/test_command_deprecations.py index 969c3746a1133..fcb95a8d6ce4b 100644 --- a/airflow-core/tests/unit/cli/commands/test_command_deprecations.py +++ b/airflow-core/tests/unit/cli/commands/test_command_deprecations.py @@ -36,6 +36,7 @@ dag_command, pool_command, provider_command, + task_command, variable_command, ) @@ -62,6 +63,11 @@ (provider_command.providers_list, "airflowctl providers list"), (config_command.get_value, "airflowctl config get"), (config_command.show_config, "airflowctl config list"), + (task_command.task_failed_deps, "airflowctl tasks failed-deps"), + (task_command.task_state, "airflowctl tasks state"), + (task_command.task_list, "airflowctl tasks list"), + (task_command.task_states_for_dag_run, "airflowctl tasks states-for-dag-run"), + (task_command.task_clear, "airflowctl tasks clear"), ]