[v3-2-test] Fix airflowctl dagrun list crash when --state is omitted (#65608)#65620
Merged
[v3-2-test] Fix airflowctl dagrun list crash when --state is omitted (#65608)#65620
Conversation
…65608) DagRunOperations.list() required a non-None state and unconditionally sent str(state) to the API. When the CLI omitted --state, argparse passed None and the API received the literal string "None", failing with "Invalid value for state. Valid values are queued, running, success, failed". Make state optional (Optional[str] = None) and only include it in the query string when provided. Give limit a sensible default (100) while we are at it so the method works when called with no args. The auto-generated `airflowctl dagrun list` command now accepts --state as a true filter instead of a required flag. Reported in #65497 (rc2 testing). (cherry picked from commit 89a021c) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
3 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.
DagRunOperations.list() required a non-None state and unconditionally
sent str(state) to the API. When the CLI omitted --state, argparse
passed None and the API received the literal string "None", failing
with "Invalid value for state. Valid values are queued, running,
success, failed".
Make state optional (Optional[str] = None) and only include it in the
query string when provided. Give limit a sensible default (100) while
we are at it so the method works when called with no args. The
auto-generated
airflowctl dagrun listcommand now accepts --state asa true filter instead of a required flag.
Reported in #65497 (rc2 testing).
(cherry picked from commit 89a021c)
Co-authored-by: Jarek Potiuk jarek@potiuk.com