uranusjr commented on a change in pull request #16352: URL: https://github.com/apache/airflow/pull/16352#discussion_r678402962
########## File path: airflow/api_connexion/endpoints/dag_run_endpoint.py ########## @@ -242,16 +242,23 @@ def post_dag_run(dag_id, session): except ValidationError as err: raise BadRequest(detail=str(err)) + execution_date = post_body["execution_date"] dagrun_instance = ( session.query(DagRun) .filter( DagRun.dag_id == dag_id, - or_(DagRun.run_id == post_body["run_id"], DagRun.execution_date == post_body["execution_date"]), + or_(DagRun.run_id == post_body["run_id"], DagRun.execution_date == execution_date), ) .first() ) if not dagrun_instance: - dag_run = DagRun(dag_id=dag_id, run_type=DagRunType.MANUAL, **post_body) + dag = current_app.dag_bag.get_dag(dag_id) + dag_run = DagRun( + dag_id=dag_id, + run_type=DagRunType.MANUAL, + data_interval=dag.timetable.infer_data_interval(execution_date), + **post_body, + ) Review comment: No; I can change this. -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org