Rishabh00b opened a new pull request, #75177: URL: https://github.com/apache/airflow/pull/75177
Running a generated airflowctl command without a field the API requires (for example `airflowctl connections create --connection-id foo`) currently crashes with a raw pydantic `ValidationError` traceback ending in `Input should be a valid string ... input_value=None`. This catches that error when the request body is built, uses `FieldInfo.is_required()` to separate missing required fields from invalid values, and exits with `the following arguments are required: --conn-type`. Invalid values are reported against their flag. No request is sent in either case. Related: #57721, parent #57633. **Note:** #74554 is already open for #57721. I opened this before noticing it. I'm happy to close this if the maintainers prefer that PR, or to rebase and fold in anything useful. **Testing:** 5 new tests in `test_cli_config.py` (fail without the change, pass with it). `ruff check`, `ruff format --check` and `mypy` pass. The full `airflow-ctl` suite gives 445 passed and 1 failed; the 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]
