uranusjr commented on code in PR #32118:
URL: https://github.com/apache/airflow/pull/32118#discussion_r1247434931


##########
airflow/cli/commands/dag_command.py:
##########
@@ -72,12 +72,17 @@ def _run_dag_backfill(dags: list[DAG], args) -> None:
 
         if args.dry_run:
             print(f"Dry run of DAG {dag.dag_id} on {args.start_date}")
-            dr = DagRun(dag.dag_id, execution_date=args.start_date)
-            for task in dag.tasks:
-                print(f"Task {task.task_id} located in DAG {dag.dag_id}")
-                ti = TaskInstance(task, run_id=None)
-                ti.dag_run = dr
-                ti.dry_run()
+            dagrun_infos = 
dag.iter_dagrun_infos_between(earliest=args.start_date, latest=args.end_date)
+            for dagrun_info in dagrun_infos:
+                dr = DagRun(
+                    dag.dag_id, execution_date=args.start_date, 
data_interval=dagrun_info.data_interval

Review Comment:
   I think we should use `dagrun_info.logical_date` for `execution_date` (the 
previous code using `args.start_date` seems like a bug to begin with)



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