Skip to content

Paginate partitioned Dag run modal requests - #68412

Merged
pierrejeambrun merged 6 commits into
apache:mainfrom
steveahnahn:partitioned-dag-run-pagination
Jun 29, 2026
Merged

pierrejeambrun merged 6 commits into
apache:mainfrom
steveahnahn:partitioned-dag-run-pagination

Conversation

@steveahnahn

@steveahnahn steveahnahn commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Adds server-side pagination to the private UI endpoint behind the pending partitioned Dag run modal, and wires the modal table state to limit and offset.

Why:

  • The endpoint materialized every matching AssetPartitionDagRun row before enrichment.
  • The response total was derived from the materialized row list, so the UI had no way to page through the full filtered result set.
  • The modal did not pass pagination state to the generated client, so opening it for a large partitioned Dag could request and render every pending partition.

What changed:

  • Accept standard limit and offset query parameters on /ui/partitioned_dag_runs.
  • Use paginated_select so the endpoint returns the full filtered total while enriching only the current page of rows.
  • Preserve the missing-Dag 404 behavior and return an empty page with the real total when offset is past the end.
  • Keep modal pagination local to the dialog, pass limit and offset to the generated client, and reset the dialog page index on close.
  • Regenerate the private UI OpenAPI client and add backend/UI regression coverage.

Validation:

  • Reproduction before fix: applying only the backend regression test to upstream/main failed because limit=2 still returned ["key-2", "key-1", "key-0"].
  • Added backend regression coverage for first page, second page, and empty page past the end: TestGetPartitionedDagRuns.test_should_paginate_partitioned_dag_runs.
  • Added UI coverage in PartitionScheduleModal.test.tsx for initial page, next page, and close/reset query parameter wiring.
  • Breeze UI smoke with 105 pending partitioned Dag runs confirmed the modal requested limit=50&offset=0, then limit=50&offset=50, then limit=50&offset=100; the final response contained 5 rows with total=105.

Screenshots

01-dags-list-pending-count 02-modal-page-1-offset-0 03-modal-final-page-offset-100-pagination
Was generative AI tooling used to co-author this PR?
  • Yes - Codex (GPT-5)

Generated-by: Codex (GPT-5) following the guidelines


Note

✅ Ready for review · @steveahnahn → @potiuk · 2026-06-12 13:30 UTC

Thanks @steveahnahn — all checks are green and this PR is marked ready for maintainer review. The ball is with the maintainers now; a maintainer will take the next look.

Automated triage — may be imperfect.

@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Jun 11, 2026
@steveahnahn
steveahnahn marked this pull request as ready for review June 11, 2026 23:23
@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Jun 12, 2026

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working as expected.

LGTM, just one comment to address then we can merge.

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, need rebase to fix conflicts, then we can merge.

…-pagination

# Conflicts:
#	airflow-core/src/airflow/api_fastapi/core_api/routes/ui/partitioned_dag_runs.py
@steveahnahn

Copy link
Copy Markdown
Contributor Author

merge conflcits fixed in 2a974a2

Build the response via model_validate (matching the rest of the route) so the
strictly-typed asset_expressions field passes mypy after the main merge; the
direct constructor tripped the static check while keeping identical behavior.
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.1 milestone Jun 29, 2026
@pierrejeambrun
pierrejeambrun merged commit fe8d870 into apache:main Jun 29, 2026
94 checks passed
karenbraganz pushed a commit to karenbraganz/airflow that referenced this pull request Jun 30, 2026
* Paginate partitioned Dag run modal requests

* Add stable secondary sort to partitioned Dag run pagination

* Fix asset_expressions typing in partitioned Dag run list response

Build the response via model_validate (matching the rest of the route) so the
strictly-typed asset_expressions field passes mypy after the main merge; the
direct constructor tripped the static check while keeping identical behavior.
@vatsrahul1001

Copy link
Copy Markdown
Contributor

Moved to 3.4.0 better suitable for minor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants