sunank200 commented on code in PR #46512:
URL: https://github.com/apache/airflow/pull/46512#discussion_r1953070837


##########
airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -357,25 +357,38 @@ def trigger_dag_run(
             f"DAG with dag_id: '{dag_id}' has import errors and cannot be 
triggered",
         )
 
-    logical_date = timezone.coerce_datetime(body.logical_date)
-    coerced_logical_date = timezone.coerce_datetime(logical_date)
-
+    logical_date = pendulum.instance(body.logical_date) if body.logical_date 
else None
+    run_after = timezone.coerce_datetime(body.run_after)
     try:
         dag: DAG = request.app.state.dag_bag.get_dag(dag_id)
-
         if body.data_interval_start and body.data_interval_end:
             data_interval = DataInterval(
                 start=pendulum.instance(body.data_interval_start),
                 end=pendulum.instance(body.data_interval_end),
             )
         else:
-            data_interval = 
dag.timetable.infer_manual_data_interval(run_after=coerced_logical_date or now)
+            if body.logical_date:
+                data_interval = dag.timetable.infer_manual_data_interval(
+                    run_after=timezone.coerce_datetime(body.logical_date)
+                )
+                run_after = data_interval.end
+            else:
+                data_interval = None
+
+        if body.dag_run_id:
+            run_id = body.dag_run_id
+        else:

Review Comment:
   I did the API change as part of 
[46616](https://github.com/apache/airflow/pull/46616).
   
   But I can take care of this in issue: 
[#46650](https://github.com/apache/airflow/issues/46650)



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

Reply via email to