hussein-awala commented on code in PR #31308:
URL: https://github.com/apache/airflow/pull/31308#discussion_r1195078799
##########
airflow/cli/cli_config.py:
##########
@@ -277,7 +277,12 @@ def string_lower_type(val):
ARG_NO_BACKFILL = Arg(
("--no-backfill",), help="filter all the backfill dagruns given the dag
id", action="store_true"
)
-ARG_STATE = Arg(("--state",), help="Only list the dag runs corresponding to
the state")
+ARG_STATE = Arg(
+ ("--state",),
+ help="Only list the dag runs corresponding to the state",
+ metavar="(running, queued, success, failed)",
+ choices=("running", "queued", "success", "failed"),
+)
Review Comment:
Nit: I always have a preference to extract the possible values dynamically
when they are based on another class/enum. But I have no objection to defining
them this way.
```suggestion
dagrun_states = tuple(state.value for state in DagRunState)
ARG_STATE = Arg(
("--state",),
help="Only list the dag runs corresponding to the state",
metavar=str(dagrun_states),
choices=dagrun_states,
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]