[v3-3-test] Add API endpoint for backfill dag run entries - #70127
Merged
Conversation
* Add GET /backfills/{backfill_id}/dag_runs endpoint
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
* Align backfill dag run response identifiers
(cherry picked from commit 6f88f29)
pierrejeambrun
requested review from
bbovenzi,
bugraoz93,
choo121600,
dheerajturaga,
ephraimbuddy,
guan404ming,
henry3260,
jason810496,
potiuk,
rawwar,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
July 20, 2026 12:40
Contributor
|
Hi maintainer, this PR was merged without a milestone set.
|
Contributor
|
Moving milestone to 3.4.0 as its more suitable for minor as its a new feature |
1 task
bbovenzi
pushed a commit
that referenced
this pull request
Aug 3, 2026
vatsrahul1001
added a commit
that referenced
this pull request
Aug 4, 2026
The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse, BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
vatsrahul1001
added a commit
that referenced
this pull request
Aug 4, 2026
…toolchain (#70670) (#70976) * Raise the datamodel-code-generator floor for the codegen toolchain (#70670) (cherry picked from commit b301429) Manual backport: datamodel-code-generator floor bumped 0.33.0 -> >=0.71.0 and models REGENERATED against v3-3-test's own spec (not copied from main). Test constructions in test_operations.py updated for the now-required nullable fields. test_task_command.py is main-only; main's divergent test_operations.py tail (ctl task-instance ops not on this branch) intentionally not backported. * Fix ConnectionResponse construction to use schema alias in airflow-ctl test The regenerated model exposes the field as `schema_` with `Field(alias="schema")` and no `populate_by_name`, so pydantic requires the alias `schema=` at construction. Matches main's fix (#70670): construct with `schema=` plus `# type: ignore[call-arg]`. * Serialize connection mock responses by alias in airflow-ctl tests ConnectionResponse.schema_ has Field(alias=schema) and no populate_by_name, so the source validates responses by the schema alias. The mock handlers dumped the model by field name, breaking the round-trip. Dump connection_response / connections_response mocks with by_alias=True (matches main #70670). * Regenerate airflow-ctl datamodels after merging v3-3-test The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse, BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
vatsrahul1001
pushed a commit
that referenced
this pull request
Aug 5, 2026
* Add GET /backfills/{backfill_id}/dag_runs endpoint
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: #46250
* Align backfill dag run response identifiers
(cherry picked from commit 6f88f29)
Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
vatsrahul1001
added a commit
that referenced
this pull request
Aug 5, 2026
vatsrahul1001
added a commit
that referenced
this pull request
Aug 5, 2026
…toolchain (#70670) (#70976) * Raise the datamodel-code-generator floor for the codegen toolchain (#70670) (cherry picked from commit b301429) Manual backport: datamodel-code-generator floor bumped 0.33.0 -> >=0.71.0 and models REGENERATED against v3-3-test's own spec (not copied from main). Test constructions in test_operations.py updated for the now-required nullable fields. test_task_command.py is main-only; main's divergent test_operations.py tail (ctl task-instance ops not on this branch) intentionally not backported. * Fix ConnectionResponse construction to use schema alias in airflow-ctl test The regenerated model exposes the field as `schema_` with `Field(alias="schema")` and no `populate_by_name`, so pydantic requires the alias `schema=` at construction. Matches main's fix (#70670): construct with `schema=` plus `# type: ignore[call-arg]`. * Serialize connection mock responses by alias in airflow-ctl tests ConnectionResponse.schema_ has Field(alias=schema) and no populate_by_name, so the source validates responses by the schema alias. The mock handlers dumped the model by field name, breaking the round-trip. Dump connection_response / connections_response mocks with by_alias=True (matches main #70670). * Regenerate airflow-ctl datamodels after merging v3-3-test The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse, BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
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.
Backport of #67381 to
v3-3-test.Cherry-picked from 6f88f29.
One conflict, in the generated
ui/openapi-gen/requests/services.gen.tsimport type { ... }line:mainhad added the newListBackfillDagRuns*imports alongside other symbols (GetDagRunStateCountsUi*,GetCalendarDeadlines*) that do not exist onv3-3-test. Resolved by keeping thev3-3-testimport list and adding onlyListBackfillDagRunsData/ListBackfillDagRunsResponse(the endpoint's own types, whichtypes.gen.tsexports here), dropping the unrelated main-only symbols. All other generated files auto-merged.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines