diff --git a/airflow-core/src/airflow/cli/commands/provider_command.py b/airflow-core/src/airflow/cli/commands/provider_command.py index 645618fd852cc..fa24b8bb8b884 100644 --- a/airflow-core/src/airflow/cli/commands/provider_command.py +++ b/airflow-core/src/airflow/cli/commands/provider_command.py @@ -22,6 +22,7 @@ import sys from airflow.cli.simple_table import AirflowConsole +from airflow.cli.utils import deprecated_for_airflowctl from airflow.providers_manager import ProvidersManager from airflow.utils.cli import suppress_logs_and_warning from airflow.utils.providers_configuration_loader import providers_configuration_loaded @@ -33,6 +34,7 @@ def _remove_rst_syntax(value: str) -> str: return re.sub("[`_<>]", "", value.strip(" \n.")) +@deprecated_for_airflowctl("airflowctl providers get") @suppress_logs_and_warning @providers_configuration_loaded def provider_get(args): @@ -55,6 +57,7 @@ def provider_get(args): raise SystemExit(f"No such provider installed: {args.provider_name}") +@deprecated_for_airflowctl("airflowctl providers list") @suppress_logs_and_warning @providers_configuration_loaded def providers_list(args): 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 9300219fe5a1e..3f082c48b4708 100644 --- a/airflow-core/tests/unit/cli/commands/test_command_deprecations.py +++ b/airflow-core/tests/unit/cli/commands/test_command_deprecations.py @@ -30,7 +30,7 @@ import pytest -from airflow.cli.commands import asset_command, dag_command, pool_command +from airflow.cli.commands import asset_command, dag_command, pool_command, provider_command # (command callable, expected airflowctl replacement recorded by the decorator) MIGRATED_CLI_COMMANDS = [ @@ -43,6 +43,8 @@ (pool_command.pool_import, "airflowctl pools import"), (pool_command.pool_export, "airflowctl pools export"), (asset_command.asset_materialize, "airflowctl assets materialize"), + (provider_command.provider_get, "airflowctl providers get"), + (provider_command.providers_list, "airflowctl providers list"), ]