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

   ### Related Issue
   Closes #77433
   
   ### Description of Changes
   In `airflowctl`, `-o json` and `-o yaml` previously converted every scalar 
value into a string via `str(value)` in `AirflowConsole._normalize_data`. This 
caused numbers (e.g. `128`) and booleans (e.g. `False`) to be serialized as 
`"128"` and `"False"`, breaking downstream parsers such as `jq`.
   
   This PR updates `AirflowConsole._normalize_data` to preserve native scalar 
types (`int`, `float`, `bool`, `str`) when the output format is `"json"` or 
`"yaml"`. Tabular formats (`"table"` and `"plain"`) continue to render string 
representations as before.
   
   ### Tests Added
   - Updated existing `test_normalize_data` assertions in 
`airflow-ctl/tests/airflow_ctl/ctl/test_console_formatting.py`.
   - Added parameterized test 
`test_normalize_data_preserves_scalar_types_for_json_and_yaml` asserting 
preservation of `int`, `float`, `bool`, `str`, `None`, and nested lists/dicts.
   - Added 
`test_normalize_data_converts_scalars_to_strings_for_table_and_plain` verifying 
text rendering for table formats.
   
   ### Verification
   - `pytest` passed (41 passed in 0.17s).
   - `ruff check` and `ruff format --check` passed with 0 errors.
   
   ### Gen-AI Disclosure
   Generated-by: Antigravity AI and Gemini 


-- 
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