Repository navigation
Improve airflowctl errors for missing required fields - #74554
shrishskulkarni wants to merge 5 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
Keep CLI-supplied values available when required API fields are positional, and use the positional syntax in connection command tests. This prevents required-field argument handling from breaking commands that provide defaults on the CLI. Co-authored-by: Copilot <[email protected]>
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
There was a problem hiding this comment.
🟡 Changes recommended
Several end-to-end commands still use option forms that the new generic positional conversion removes.
2 open findings
What changed in this PR
Improves airflowctl validation by exposing required request-body fields as positional CLI arguments.
Changes:
- Generates positional arguments for required non-boolean model fields.
- Preserves the default logical date for Dag triggers.
- Updates CLI and end-to-end tests for positional connection arguments.
| File | Description |
|---|---|
airflow-ctl/src/airflowctl/ctl/cli_config.py |
Updates argument generation and CLI defaults. |
airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py |
Tests positional fields and Dag trigger defaults. |
airflow-ctl-tests/tests/airflowctl_tests/test_airflowctl_commands.py |
Updates connection command invocations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Updated comments to correct formatting and symbols. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Keep end-to-end command examples aligned with the positional syntax for required request-body fields. Co-authored-by: Copilot <[email protected]>
|
@henry3260 I believe the AI comments are resolved. Let me know if any further changes are required. Thanks. |
|
Closing in favor of #75177, as the latter avoids breaking changes |


Improve validation of missing required fields in
airflowctlby representing required non-boolean API request-body fields as positional arguments instead of options. This allowsargparseto report missing required values using its standard validation errors.Optional and defaulted fields remain options. The CLI-provided default for
dags trigger'slogical_dateis preserved, allowing it to be omitted from the command. Connection command tests are updated to use positional arguments.Closes #57721
Testing
airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py: 69 tests passed (2 warnings).mypy-airflow-ctlrepository hook passed.os.getuid(). No end-to-end tests were collected.Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot in VS Code, following the Apache Airflow Gen-AI contribution guidelines