Lee-W commented on code in PR #61464:
URL: https://github.com/apache/airflow/pull/61464#discussion_r2839584418
##########
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:
Ideally, this should not happen. It should be blocked from the API or even
the UI layer.
> Why does the function need to return a list if we only need the first?
(The previous code uses all the infos returned here)
We actally pass the list to the following functions
--
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]