You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/04 09:25:21 UTC

[GitHub] [airflow] fbertos commented on a change in pull request #20485: Add filter by state in DagRun REST API (List Dag Runs)

fbertos commented on a change in pull request #20485:
URL: https://github.com/apache/airflow/pull/20485#discussion_r777933839



##########
File path: airflow/api_connexion/endpoints/dag_run_endpoint.py
##########
@@ -204,6 +207,10 @@ def get_dag_runs_batch(*, session: Session = NEW_SESSION) -> APIResponse:
     else:
         query = query.filter(DagRun.dag_id.in_(readable_dag_ids))
 
+    if data.get("states"):
+        states = set(data["states"])
+        query = query.filter(DagRun.state.in_(states))

Review comment:
       Hi @uranusjr , thanks for your recommendation, but after that change I had this errors:
   E       TypeError: 'NoneType' object is not iterable
   
   So I put it back as the other lines (f.i. variable dag_ids, line 205) with the variable inside the block.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org