ColtenOuO opened a new pull request, #73270:
URL: https://github.com/apache/airflow/pull/73270

   ### Sumarry
   
   When nothing matched, `airflow plugins` and `airflow dags pause` / `airflow 
dags unpause` printed a hard-coded prose message ("No plugins loaded", "No 
unpaused DAGs were found") before reaching `AirflowConsole().print_as`, so 
`--output json` and `--output yaml` were ignored on that path and callers 
piping into `jq` or a YAML parser got output they cannot parse.
   
   The `[]` output comes from `AirflowConsole` in 
`airflow-core/src/airflow/cli/simple_table.py`: `print_as` dispatches on 
`--output`, and for an empty list `print_as_json` renders `json.dumps([])` and 
`print_as_yaml` renders `yaml.dump([])`, both of which produce `[]`, while 
`print_as_table` / `print_as_plain_table` print "No data found". The other 
list-style commands (e.g. `airflow dags list`, `airflow pools list`, `airflow 
variables list`) hand the possibly-empty result straight to `print_as` and 
therefore already behave this way, and `airflow-core/docs/howto/usage-cli.rst` 
documents it ("the default output when there are no errors is `No data found`, 
and the json output is `[]`"). `airflow teams list` was aligned with that 
convention in #72945.
   
   This PR makes the two remaining commands follow the same convention for 
structured output by passing the empty result to `print_as` for `json` / `yaml`.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to