This is an automated email from the ASF dual-hosted git repository.
potiuk 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 bdf2abcbc65 Remove ignored --output flag from airflow pools set and
delete (#72833)
bdf2abcbc65 is described below
commit bdf2abcbc6523d6a8f2d5197e7c03ba0244dd5f4
Author: Y-C <[email protected]>
AuthorDate: Thu Sep 10 07:19:58 2026 +0800
Remove ignored --output flag from airflow pools set and delete (#72833)
Both commands advertised -o/--output in their help but never read the
value: #12704 replaced the table rendering with a fixed confirmation
message and left ARG_OUTPUT in the argument table. #13071 removed the
same orphaned flag from pools import/export but missed set and delete,
so the help has promised a format choice it cannot deliver ever since.
Dropping the flag makes the help truthful and brings the pools group in
line with connections and variables, where only list and get take -o.
Co-authored-by: Eason09053360
<[email protected]>
---
airflow-core/src/airflow/cli/cli_config.py | 3 +--
airflow-core/tests/unit/cli/test_cli_parser.py | 15 +++++++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/cli/cli_config.py
b/airflow-core/src/airflow/cli/cli_config.py
index 35088c129b9..9ab2d84a331 100644
--- a/airflow-core/src/airflow/cli/cli_config.py
+++ b/airflow-core/src/airflow/cli/cli_config.py
@@ -1594,7 +1594,6 @@ POOLS_COMMANDS = (
ARG_POOL_DESCRIPTION,
ARG_POOL_INCLUDE_DEFERRED,
ARG_POOL_TEAM_NAME,
- ARG_OUTPUT,
ARG_VERBOSE,
),
),
@@ -1602,7 +1601,7 @@ POOLS_COMMANDS = (
name="delete",
help="Delete pool",
func=lazy_load_command("airflow.cli.commands.pool_command.pool_delete"),
- args=(ARG_POOL_NAME, ARG_OUTPUT, ARG_VERBOSE),
+ args=(ARG_POOL_NAME, ARG_VERBOSE),
),
ActionCommand(
name="import",
diff --git a/airflow-core/tests/unit/cli/test_cli_parser.py
b/airflow-core/tests/unit/cli/test_cli_parser.py
index 4d4be678059..97e01942022 100644
--- a/airflow-core/tests/unit/cli/test_cli_parser.py
+++ b/airflow-core/tests/unit/cli/test_cli_parser.py
@@ -620,6 +620,21 @@ class TestCli:
"airflow db export-archived command error: argument
--export-format: invalid choice" in error_msg
)
+ @pytest.mark.parametrize(
+ "argv",
+ [
+ pytest.param(["pools", "set", "foo", "1", "test", "--output",
"json"], id="set"),
+ pytest.param(["pools", "delete", "foo", "--output", "json"],
id="delete"),
+ ],
+ )
+ def test_pools_set_and_delete_reject_output_flag(self, argv):
+ with contextlib.redirect_stderr(StringIO()) as stderr:
+ parser = cli_parser.get_parser()
+ with pytest.raises(SystemExit) as e:
+ parser.parse_args(argv)
+ assert e.value.code == 2
+ assert "unrecognized arguments: --output json" in stderr.getvalue()
+
@pytest.mark.parametrize(
"action_cmd",
[