prabhusneha commented on code in PR #45062:
URL: https://github.com/apache/airflow/pull/45062#discussion_r1907066944
##########
airflow/models/backfill.py:
##########
@@ -316,21 +396,15 @@ def _create_backfill(
)
if not dag_model:
raise RuntimeError(f"Dag {dag_id} not found")
- for info in dagrun_info_list:
- backfill_sort_ordinal += 1
- _create_backfill_dag_run(
- dag=dag,
- info=info,
- backfill_id=br.id,
- dag_run_conf=br.dag_run_conf,
- reprocess_behavior=br.reprocess_behavior,
- backfill_sort_ordinal=backfill_sort_ordinal,
- session=session,
- )
- log.info(
- "created backfill dag run dag_id=%s backfill_id=%s, info=%s",
- dag.dag_id,
- br.id,
- info,
- )
- return br
+
+ backfill_response = _create_backfill_dag_run(
Review Comment:
renamed to logical_dates
##########
airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -206,3 +208,40 @@ def create_backfill(
status_code=status.HTTP_409_CONFLICT,
detail=f"There is already a running backfill for dag
{backfill_request.dag_id}",
)
+
+
+@backfills_router.post(
+ path="/dry_run",
+ responses=create_openapi_http_exception_doc(
+ [
+ status.HTTP_404_NOT_FOUND,
+ status.HTTP_409_CONFLICT,
+ ]
+ ),
+)
+def create_backfill_dry_run(
+ body: BackfillPostBody,
+) -> DryRunBackfillCollectionResponse:
+ from_date = timezone.coerce_datetime(body.from_date)
+ to_date = timezone.coerce_datetime(body.to_date)
+
+ try:
+ backfills_dry_run = _create_backfill(
+ dag_id=body.dag_id,
+ from_date=from_date,
+ to_date=to_date,
+ max_active_runs=body.max_active_runs,
+ reverse=body.run_backwards,
+ dag_run_conf=body.dag_run_conf,
+ reprocess_behavior=body.reprocess_behavior,
+ dry_run=True,
+ )
+ backfills = [DryRunBackfillResponse(logical_date=logical_date) for
logical_date in backfills_dry_run]
Review Comment:
modified
--
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]