Fix airflowctl dagrun list crash when --state is omitted#65608
Fix airflowctl dagrun list crash when --state is omitted#65608potiuk merged 1 commit intoapache:mainfrom
Conversation
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 apache#65497 (rc2 testing).
|
cc: @bugraoz93 - I think that one is good to fix for rc3 |
|
Hi maintainer, this PR was merged without a milestone set.
|
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 89a021c 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. |
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…65608) (#65620) 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>
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).
* Fix airflowctl dagrun list crash when --state is omitted (#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). * Fix airflow-ctl missing pyyaml runtime dependency (#65489) * Cap airflow-ctl httpx dependency below 1.0 (#65607) httpx 1.0 (currently 1.0.dev3 on PyPI) is a ground-up API rewrite: the entire exception hierarchy (HTTPStatusError, RequestError, ConnectError, ReadError, TimeoutException, ...) was removed and client/transport/auth interfaces were redesigned. airflow-ctl today uses httpx.HTTPStatusError, httpx.ConnectError, AsyncClient, and Response.raise_for_status() throughout api/client.py and api/operations.py, so pre-release httpx 1.x breaks import-time (ModuleNotFoundError / AttributeError) and the tool fails to start. Cap to <1.0 so users who pass --pre / --prerelease=allow do not accidentally pull the rewrite. The full migration to httpx 1.x is tracked at #65609 and the cap carries a comment pointing at that URL so the link survives after this PR merges. * Prepare airflow-ctl 0.1.4rc3 release (#65634)
`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).
Test plan
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.7 (1M context) following the guidelines