Repository navigation
Fix airflowctl operations create command validation error - #69317
Conversation
SameerMesiah97
left a comment
There was a problem hiding this comment.
I think there are a few thing wrong with this PR (even though it looks a simple fix):
-
Is this actually a bug? From the traceback it looks like
airflowctl connections createis being invoked without the required connection information. The poor UX is theValidationError, but I'm not convinced changing the API is the right fix for invalid input -
The traceback suggest execption is raised while constructing the
ConnectionBodyincli_config.py, beforeclient.connections.create()is ever called. Shouldn't the fix (if needed) live there instead? -
Doesn't this introduce a breaking change? Existing callers of
client.connections.create()will now need to provideconnection_idandconn_typeexplicitly. -
Why do
connection_idandconn_typeneed to be separate parameters at all? They're already required fields onConnectionBody, so this duplicates the source of truth and allows the values to diverge.
I think 1 should be addressed first. Could you provide a resproduction that illustrates that this is a genuine bug rather than due to invalid user input? I believe what might be needed here is clearer error logging that surfaces the root cause i.e. missing arguments rather a type validation error.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
c6e11eb to
ddeadcf
Compare
ddeadcf to
0ea6a12
Compare
Backport failed to create: airflow-ctl/v0-1-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 1c3b3de airflow-ctl/v0-1-testThis should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
#69317 made required request-body fields required in argparse, and #75177 added a test expecting the post-parse validation to report a missing --conn-type. Each passed on its own, but together argparse rejects the command during parsing, so the test failed on main. The argparse error is the intended behaviour; the test now checks it.
…dation error (apache#69317) The only conflict was context: _find_subgroup_suffix from the operation subgroups change is not on this branch and stays out. The fix itself applies unchanged. (cherry picked from commit 1c3b3de) Co-authored-by: Pratiksha Badheka <[email protected]>
…he#76092) apache#69317 made required request-body fields required in argparse, and apache#75177 added a test expecting the post-parse validation to report a missing --conn-type. Each passed on its own, but together argparse rejects the command during parsing, so the test failed on main. The argparse error is the intended behaviour; the test now checks it. (cherry picked from commit 9c164b5)
…dation error (#69317) (#76116) * [airflow-ctl/v0-1-test] Fix airflowctl operations create command validation error (#69317) The only conflict was context: _find_subgroup_suffix from the operation subgroups change is not on this branch and stays out. The fix itself applies unchanged. (cherry picked from commit 1c3b3de) Co-authored-by: Pratiksha Badheka <[email protected]> * Fix airflowctl required-option test broken by concurrent merges (#76092) #69317 made required request-body fields required in argparse, and #75177 added a test expecting the post-parse validation to report a missing --conn-type. Each passed on its own, but together argparse rejects the command during parsing, so the test failed on main. The argparse error is the intended behaviour; the test now checks it. (cherry picked from commit 9c164b5) --------- Co-authored-by: Pratiksha Badheka <[email protected]>
…dation error (#69317) (#76116) * [airflow-ctl/v0-1-test] Fix airflowctl operations create command validation error (#69317) The only conflict was context: _find_subgroup_suffix from the operation subgroups change is not on this branch and stays out. The fix itself applies unchanged. (cherry picked from commit 1c3b3de) Co-authored-by: Pratiksha Badheka <[email protected]> * Fix airflowctl required-option test broken by concurrent merges (#76092) #69317 made required request-body fields required in argparse, and #75177 added a test expecting the post-parse validation to report a missing --conn-type. Each passed on its own, but together argparse rejects the command during parsing, so the test failed on main. The argparse error is the intended behaviour; the test now checks it. (cherry picked from commit 9c164b5) --------- Co-authored-by: Pratiksha Badheka <[email protected]>
airflowctl operations create command failed validation error on pydantic side not arg side this throws error and check response in arg parseand
All required postional params pass through command but these are required params and part of that body response .
i havecheked pools , connections create command shows error since the input body required whole entity as response and
pydanic failed on validation errror this PR aims to catch errors before processing
airflowctl connections createshows Traceback (most recent call last):Add
is_required()flag toargto catch required params also add tests for all operations methodAdd a static method to check params with none value but not defaults
After fix :
airflowctl connections create… tests
Was generative AI tooling used to co-author this PR?
{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.Important
🛠️ Maintainer triage note for @Prab-27 · by
@potiuk· 2026-07-08 15:38 UTCHelpful heads-up from the maintainers — please address before this PR can be reviewed:
Additional PROD image tests / Airflow CTL integration tests with PROD image). See the contributor guide.Full criteria: Pull Request quality criteria.
The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.
Automated triage — may be imperfect; a maintainer takes the next look.