Make required params positional for auto-generated airflowctl commands#64812
Open
shivaam wants to merge 2 commits intoapache:mainfrom
Open
Make required params positional for auto-generated airflowctl commands#64812shivaam wants to merge 2 commits intoapache:mainfrom
shivaam wants to merge 2 commits intoapache:mainfrom
Conversation
apache#60142) Required non-boolean parameters in auto-generated CLI commands are now positional instead of flag-style, improving UX consistency with manually defined commands like `dags pause`. For primitive params parsed via AST, uses default detection to determine positional vs flag. For Pydantic model fields, uses `is_required()`.
4a30b1e to
8c4f945
Compare
2 tasks
bugraoz93
reviewed
Apr 7, 2026
Contributor
bugraoz93
left a comment
There was a problem hiding this comment.
Thanks for the PR! I addressed your question. Could you please amend it to be both optional and positional, live side by side?
This way, we won't break anything while working, but rather add Airflow CLI positional arguments to improve parity and make migrations easier.
| @@ -0,0 +1 @@ | |||
| Required non-boolean parameters in auto-generated airflowctl commands are now positional instead of flag-style (e.g., ``airflowctl dags get example_dag`` instead of ``airflowctl dags get --dag-id=example_dag``). | |||
Contributor
There was a problem hiding this comment.
This news fragment is for Airflow Core and not related to anything within airflowctl flow.
Since we are still in 0.x, significant changes are also expected at a certain level.
We are logging these things in the release notes
https://airflow.apache.org/docs/apache-airflow-ctl/stable/release_notes.html#significant-changes
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.
Required non-boolean parameters in auto-generated CLI commands are now positional instead of flag-style, improving UX consistency with manually defined commands like
dags pause.Before:
After:
airflowctl connections create test mysql --password=secret airflowctl dags get example_bash_operatorChanges
is_required()to decide positional vs flag_UNSETforarg_destdefault to avoid argparse crash on positional argshas_defaultmetadata key at runtime when mapping CLI args to method paramsNotes
_create_argstays a dumb pass-through builder — all positional/flag logic is in the callers via one-liner conditionals--flag/--no-flag)--flag=valuesyntax for required params will no longer work. Since airflowctl is new and not yet stable, this should be acceptable.Open question
Posted a clarifying question on the issue about whether all required params should be positional (e.g.,
xcom addhas 5 positional args), or if we should limit it.closes: #60142
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 4.6) following the guidelines