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

dheerajturaga 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 72d42aebdec Fix airflow dags list --columns help showing wrong default 
columns (#72607)
72d42aebdec is described below

commit 72d42aebdec5c28a6dbf98497ea9597b793523ab
Author: Y-C <[email protected]>
AuthorDate: Mon Sep 7 13:11:45 2026 +0800

    Fix airflow dags list --columns help showing wrong default columns (#72607)
    
    The help text listed four default columns and named one of them
    "owner", while the actual default renders six columns and the valid
    field is "owners". Following the help therefore produced an "invalid
    columns" error and a table missing the owners column, and the generated
    CLI reference documentation carried the same mistake.
    
    Derive the help text from the same tuple used as the default so the
    two cannot drift apart again, and guard both --columns arguments with a
    test.
    
    Co-authored-by: Eason09053360 
<[email protected]>
---
 airflow-core/src/airflow/cli/cli_config.py     |  5 +++--
 airflow-core/tests/unit/cli/test_cli_parser.py | 12 ++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/airflow-core/src/airflow/cli/cli_config.py 
b/airflow-core/src/airflow/cli/cli_config.py
index 813bf0704fc..f112cfcf9c2 100644
--- a/airflow-core/src/airflow/cli/cli_config.py
+++ b/airflow-core/src/airflow/cli/cli_config.py
@@ -1056,11 +1056,12 @@ ARG_TRIGGERER_TEAM_NAME = Arg(
     help="Team name to scope this triggerer to. Requires core.multi_team to be 
enabled.",
 )
 
+DEFAULT_DAG_LIST_COLUMNS = ("dag_id", "fileloc", "owners", "is_paused", 
"bundle_name", "bundle_version")
 ARG_DAG_LIST_COLUMNS = Arg(
     ("--columns",),
     type=string_list_type,
-    help="List of columns to render. (default: ['dag_id', 'fileloc', 'owner', 
'is_paused'])",
-    default=("dag_id", "fileloc", "owners", "is_paused", "bundle_name", 
"bundle_version"),
+    help=f"List of columns to render. (default: 
{list(DEFAULT_DAG_LIST_COLUMNS)})",
+    default=DEFAULT_DAG_LIST_COLUMNS,
 )
 
 ARG_ASSET_LIST_COLUMNS = Arg(
diff --git a/airflow-core/tests/unit/cli/test_cli_parser.py 
b/airflow-core/tests/unit/cli/test_cli_parser.py
index 2a0680f08ef..4d4be678059 100644
--- a/airflow-core/tests/unit/cli/test_cli_parser.py
+++ b/airflow-core/tests/unit/cli/test_cli_parser.py
@@ -550,6 +550,18 @@ class TestCli:
             f"Please update ARG_VAR_IMPORT help message in cli_config.py to 
include: {', '.join([f'.{fmt}' for fmt in sorted(missing_in_help)])}"
         )
 
+    @pytest.mark.parametrize(
+        "arg",
+        [
+            pytest.param(cli_config.ARG_DAG_LIST_COLUMNS, id="dags-list"),
+            pytest.param(cli_config.ARG_ASSET_LIST_COLUMNS, id="assets-list"),
+        ],
+    )
+    def test_list_columns_help_matches_default(self, arg):
+        default_columns = list(arg.kwargs["default"])
+
+        assert f"(default: {default_columns})" in arg.kwargs["help"]
+
     @pytest.mark.parametrize(
         ("executor", "expected_args"),
         [

Reply via email to