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


##########
airflow-core/src/airflow/models/backfill.py:
##########
@@ -542,34 +615,94 @@ def _create_backfill(
         session.add(br)
         session.commit()
 
+        dag_model = session.scalar(select(DagModel).where(DagModel.dag_id == 
dag_id))
+        if not dag_model:
+            raise RuntimeError(f"Dag {dag_id} not found")
+
         dagrun_info_list = _get_info_list(
             from_date=from_date,
             to_date=to_date,
             reverse=reverse,
             dag=dag,
         )
+        if not dagrun_info_list:
+            raise RuntimeError(f"No runs to create for Dag {dag_id}")

Review Comment:
   Is this supposed to never happen? Why does the function need to return a 
list if we only need the first? (The previous code uses all the infos returned 
here)



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