vikramcse commented on a change in pull request #15174:
URL: https://github.com/apache/airflow/pull/15174#discussion_r606796068



##########
File path: airflow/api_connexion/endpoints/dag_run_endpoint.py
##########
@@ -240,14 +241,26 @@ def post_dag_run(dag_id, session):
         post_body = dagrun_schema.load(request.json, session=session)
     except ValidationError as err:
         raise BadRequest(detail=str(err))
+
     dagrun_instance = (
-        session.query(DagRun).filter(DagRun.dag_id == dag_id, DagRun.run_id == 
post_body["run_id"]).first()
+        session.query(DagRun)
+        .filter(
+            or_(DagRun.run_id == post_body["run_id"], DagRun.execution_date == 
post_body["execution_date"])
+        )

Review comment:
       @kaxil apologies for the confusion
   I missed the the `dag_id` filter mistakenly. I have added the condition 
again into the query.
   Thanks you very much for suggesting the changes 




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to