Adds a new public API endpoint for backfill dag run entries - ` GET /backfills/{backfill_id}/dag_runs#67381
Open
shivaam wants to merge 1 commit into
Open
Adds a new public API endpoint for backfill dag run entries - ` GET /backfills/{backfill_id}/dag_runs#67381shivaam wants to merge 1 commit into
shivaam wants to merge 1 commit into
Conversation
Adds a new public API endpoint that returns the BackfillDagRun entries for a given backfill with joined DagRun state. Users can see what happened in a backfill: which dates ran, their states (queued, running, success, failed), and which slots were skipped (with reason). - BackfillDagRunResponse / BackfillDagRunCollectionResponse models - LEFT OUTER JOIN via joinedload includes skipped slots (null dag_run_id) - Pagination via limit/offset, default ordering by sort_ordinal - 404 when backfill doesn't exist - 8 unit tests covering happy path, skipped slots, 404, pagination, empty backfill, and ordering contract closes: apache#46250
1 task
Contributor
Author
|
@vatsrahul1001 tagging you since you mentioned you were planning to work on it. |
shivaam
commented
May 23, 2026
| select_stmt, total_entries = paginated_select( | ||
| statement=select(BackfillDagRun) | ||
| .where(BackfillDagRun.backfill_id == backfill_id) | ||
| .options(joinedload(BackfillDagRun.dag_run)), |
Contributor
Author
There was a problem hiding this comment.
joinedload issues a LEFT OUTER JOIN, preserving rows where dag_run_id is NULL (skipped slots).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new public API endpoint
GET /backfills/{backfill_id}/dag_runsthat returnsthe
BackfillDagRunentries for a given backfill with joinedDagRunstate. Userscan see what happened in a backfill: which dates ran, their states, and which slots
were skipped (with reason).
Previous PR: #64089 explored enriching
BackfillResponsedirectly. Based onfeedback from @uranusjr, this PR takes the cleaner approach of a dedicated
sub-resource endpoint.
Changes
BackfillDagRunResponse/BackfillDagRunCollectionResponsePydantic modelswith
AliasPathfor joinedDagRunfields (matching existingBackfillResponsepattern)list_backfill_dag_runs()route usingjoinedload(BackfillDagRun.dag_run)— LEFT OUTER JOINincludes skipped slots where
dag_run_idis NULLlimit/offset, default ordering bysort_ordinalResponse shape
{ "backfill_dag_runs": [ { "id": 1, "backfill_id": 1, "dag_run_id": 42, "logical_date": "2024-01-01T00:00:00Z", "partition_key": null, "sort_ordinal": 1, "exception_reason": null, "dag_run_state": "success", "dag_run_run_id": "backfill__2024-01-01T00:00:00+00:00" }, { "id": 2, "backfill_id": 1, "dag_run_id": null, "logical_date": "2024-01-02T00:00:00Z", "partition_key": null, "sort_ordinal": 2, "exception_reason": "already exists", "dag_run_state": null, "dag_run_run_id": null } ], "total_entries": 10 }Follow-up PRs
airflow backfill listandairflow backfill list-runscommandscloses: #46250
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (claude-opus-4-6) following the guidelines