Skip to content

Require generated request body flags in airflowctl#68000

Open
ibobgunardi wants to merge 1 commit into
apache:mainfrom
ibobgunardi:bobi/airflowctl-required-field-message
Open

Require generated request body flags in airflowctl#68000
ibobgunardi wants to merge 1 commit into
apache:mainfrom
ibobgunardi:bobi/airflowctl-required-field-message

Conversation

@ibobgunardi
Copy link
Copy Markdown

Generated airflowctl commands expand request-body models into CLI flags, but required Pydantic fields were still optional to argparse. That let the command reach request-body validation before telling the user what was missing.

This passes field_info.is_required() through when building those flags, so commands like connections create report missing required fields as normal CLI arguments.

closes: #57721

Tests:

  • .venv\Scripts\python.exe -m pytest airflow-ctl\tests\airflow_ctl\ctl\test_cli_config.py -q --confcutdir=airflow-ctl\tests\airflow_ctl\ctl
  • .venv\Scripts\python.exe -m py_compile airflow-ctl\src\airflowctl\ctl\cli_config.py airflow-ctl\tests\airflow_ctl\ctl\test_cli_config.py

Was generative AI tooling used to co-author this PR?
  • Yes (OpenAI Codex)

Generated-by: OpenAI Codex following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the error message when a required field from the API is not provided

1 participant