Repository navigation
[airflow-ctl/v0-1-test] Report missing required airflowctl options as readable errors (#75177) - #76089
Merged
shahar1 merged 1 commit intoOct 30, 2026
Conversation
… readable errors (#75177) When a generated airflowctl command such as `connections create` is run without a datamodel field that the API requires, the unset option reaches pydantic as None and the CLI crashes with a raw ValidationError traceback ("Input should be a valid string ... input_value=None"). Catch the ValidationError when the request body is built, use pydantic's FieldInfo.is_required() to tell missing required fields from invalid values, and exit with a message naming the flags, e.g. "the following arguments are required: --conn-type". Invalid values are reported against their flag. No request is sent in either case. Part of #57633, addresses #57721. (cherry picked from commit fbc18bc) Co-authored-by: Rishabh <[email protected]>
1 task done
shahar1
marked this pull request as ready for review
October 30, 2026 21:02
shahar1
requested review from
bugraoz93,
dheerajturaga and
potiuk
as code owners
October 30, 2026 21:02
shahar1
approved these changes
Oct 30, 2026
shahar1
enabled auto-merge (squash)
October 30, 2026 21:02
This was referenced Oct 30, 2026
shahar1
pushed a commit
that referenced
this pull request
Nov 19, 2026
… readable errors (#75177) (#76089) When a generated airflowctl command such as `connections create` is run without a datamodel field that the API requires, the unset option reaches pydantic as None and the CLI crashes with a raw ValidationError traceback ("Input should be a valid string ... input_value=None"). Catch the ValidationError when the request body is built, use pydantic's FieldInfo.is_required() to tell missing required fields from invalid values, and exit with a message naming the flags, e.g. "the following arguments are required: --conn-type". Invalid values are reported against their flag. No request is sent in either case. Part of #57633, addresses #57721. (cherry picked from commit fbc18bc) Co-authored-by: Rishabh <[email protected]>
28 of 67 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a generated airflowctl command such as
connections createis runwithout a datamodel field that the API requires, the unset option reaches
pydantic as None and the CLI crashes with a raw ValidationError traceback
("Input should be a valid string ... input_value=None").
Catch the ValidationError when the request body is built, use pydantic's
FieldInfo.is_required() to tell missing required fields from invalid values,
and exit with a message naming the flags, e.g.
"the following arguments are required: --conn-type". Invalid values are
reported against their flag. No request is sent in either case.
Part of #57633, addresses #57721.
(cherry picked from commit fbc18bc)
Co-authored-by: Rishabh [email protected]