Rishabh00b opened a new pull request, #75176: URL: https://github.com/apache/airflow/pull/75176
`airflowctl connections import` assumed the file was a JSON object of objects. A file holding a list, a scalar, or an entry that is not an object failed with internal messages such as `'list' object has no attribute 'items'` or `'str' object has no attribute 'get'`. This checks the structure right after parsing, before any request is built, and exits with a message naming the file, the offending connection id and the expected shape. `variables import` and `pools import` already validate their input the same way. No request is sent for a malformed file. **Testing:** 4 new tests in `test_connections_command.py` (fail without the change, pass with it). `ruff check`, `ruff format --check` and `mypy` pass. The full `airflow-ctl` suite gives 444 passed and 1 failed; that failure (`test_import_rejects_non_object_json`) also occurs on `main` because my sandbox has no keyring backend. I did not run `prek` or Breeze. **Was generative AI tooling used to co-author this PR?** - [X] Yes (Claude Code, Claude Sonnet 5.5) Generated-by: Claude Code (Claude Sonnet 5.5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01PLWtW8cKWizvRLaFPf8BQD -- 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]
