This is an automated email from the ASF dual-hosted git repository.

Lee-W pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b74521b5488 [AIP-94] Mark variables CLI commands as migrated to 
airflowctl (#68932)
b74521b5488 is described below

commit b74521b54885092613439fa5dbf1e50472dcd9e9
Author: PoAn Yang <[email protected]>
AuthorDate: Mon Jun 29 21:23:55 2026 +0900

    [AIP-94] Mark variables CLI commands as migrated to airflowctl (#68932)
    
    Signed-off-by: PoAn Yang <[email protected]>
---
 airflow-core/src/airflow/cli/commands/variable_command.py         | 7 ++++++-
 airflow-core/tests/unit/cli/commands/test_command_deprecations.py | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/airflow-core/src/airflow/cli/commands/variable_command.py 
b/airflow-core/src/airflow/cli/commands/variable_command.py
index 5216aabb446..194b02b529a 100644
--- a/airflow-core/src/airflow/cli/commands/variable_command.py
+++ b/airflow-core/src/airflow/cli/commands/variable_command.py
@@ -26,7 +26,7 @@ from typing import TYPE_CHECKING
 from sqlalchemy import select
 
 from airflow.cli.simple_table import AirflowConsole
-from airflow.cli.utils import SENSITIVE_PLACEHOLDER, print_export_output
+from airflow.cli.utils import SENSITIVE_PLACEHOLDER, 
deprecated_for_airflowctl, print_export_output
 from airflow.exceptions import (
     AirflowFileParseException,
     AirflowUnsupportedFileTypeException,
@@ -63,6 +63,7 @@ class VariableDisplayMapper:
         return {"key": key, "val": val}
 
 
+@deprecated_for_airflowctl("airflowctl variables list")
 @suppress_logs_and_warning
 @providers_configuration_loaded
 def variables_list(args):
@@ -92,6 +93,7 @@ def variables_list(args):
             AirflowConsole().print_as(data=variables, output=args.output, 
mapper=None)
 
 
+@deprecated_for_airflowctl("airflowctl variables get")
 @suppress_logs_and_warning
 @providers_configuration_loaded
 def variables_get(args):
@@ -108,6 +110,7 @@ def variables_get(args):
 
 
 @cli_utils.action_cli
+@deprecated_for_airflowctl("airflowctl variables create")
 @providers_configuration_loaded
 def variables_set(args):
     """Create new variable with a given name, value and description."""
@@ -116,6 +119,7 @@ def variables_set(args):
 
 
 @cli_utils.action_cli
+@deprecated_for_airflowctl("airflowctl variables delete")
 @providers_configuration_loaded
 def variables_delete(args):
     """Delete variable by a given name."""
@@ -124,6 +128,7 @@ def variables_delete(args):
 
 
 @cli_utils.action_cli
+@deprecated_for_airflowctl("airflowctl variables import")
 @providers_configuration_loaded
 @provide_session
 def variables_import(args, *, session: Session = NEW_SESSION):
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 59ea38bfa19..28cf70d70ab 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 @@ from __future__ import annotations
 
 import pytest
 
-from airflow.cli.commands import asset_command, dag_command, pool_command
+from airflow.cli.commands import asset_command, dag_command, pool_command, 
variable_command
 
 # (command callable, expected airflowctl replacement recorded by the decorator)
 MIGRATED_CLI_COMMANDS = [
@@ -42,6 +42,11 @@ MIGRATED_CLI_COMMANDS = [
     (pool_command.pool_delete, "airflowctl pools delete"),
     (pool_command.pool_import, "airflowctl pools import"),
     (pool_command.pool_export, "airflowctl pools export"),
+    (variable_command.variables_list, "airflowctl variables list"),
+    (variable_command.variables_get, "airflowctl variables get"),
+    (variable_command.variables_set, "airflowctl variables create"),
+    (variable_command.variables_delete, "airflowctl variables delete"),
+    (variable_command.variables_import, "airflowctl variables import"),
     (asset_command.asset_materialize, "airflowctl assets materialize"),
     (asset_command.asset_list, "airflowctl assets list / airflowctl assets 
list-aliases"),
     (asset_command.asset_details, "airflowctl assets get / airflowctl assets 
get-by-alias"),

Reply via email to