fbertos commented on a change in pull request #20485:
URL: https://github.com/apache/airflow/pull/20485#discussion_r776860727
##########
File path: airflow/api_connexion/endpoints/dag_run_endpoint.py
##########
@@ -164,6 +165,9 @@ def get_dag_runs(
else:
query = query.filter(DagRun.dag_id == dag_id)
+ if state:
+ query = query.filter(DagRun.state.in_(state))
Review comment:
Hi @kaxil, thanks for your recommendations. I will change the datatype
to Optional[List[str]], however I am not sure it is a good idea to change to
plural as the FilterState query component is defined in singular in the
specification v1.yml, even being an array:
```
FilterState:
in: query
**name: state**
schema:
**type: array**
items:
type: string
required: false
description:
The value can be repeated to retrieve multiple matching values (OR
condition).
```
To change that to plural I would need to create a new FilterStates query
component....
On the other hand in the batch method I did use plural to match with the
other existing fields (for instance dag_ids):
```
{
"order_by": "string",
"page_offset": 0,
"page_limit": 100,
"**dag_ids**": [
"string"
],
...
"states": [
"string"
]
}
```
--
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]