Skip to content

Add cursor based pagination for get_dag_runs endpoint#65604

Merged
pierrejeambrun merged 3 commits into
apache:mainfrom
pierrejeambrun:cursor-pagination-dagruns
Apr 23, 2026
Merged

Add cursor based pagination for get_dag_runs endpoint#65604
pierrejeambrun merged 3 commits into
apache:mainfrom
pierrejeambrun:cursor-pagination-dagruns

Conversation

@pierrejeambrun
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun commented Apr 21, 2026

Add cursor-based (keyset) pagination as an alternative to offset-based pagination on the get_dag_runs endpoint. Offset pagination remains the default and is not deprecated. Mirrors the pattern introduced for get_task_instances in #64845.

  • Response schema adds next_cursor / previous_cursor and makes total_entries optional (populated only for offset pagination).
  • Fetch limit+1 rows to detect the last page and return next_cursor=null when no more results exist.
  • Rewire the DagRuns listing page to use cursor pagination via the DataTable's cursorPagination prop, which eliminates the COUNT(*) query for large datasets.

related: #64845

Screen.Recording.2026-04-22.at.14.11.41.mov

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7 1M context)

Generated-by: Claude Code (Opus 4.7 1M context) following the guidelines

@pierrejeambrun
Copy link
Copy Markdown
Member Author

Needs more testing and iterations.

Add cursor-based (keyset) pagination as an alternative to offset-based
pagination on the get_dag_runs endpoint. Offset pagination remains the
default and is not deprecated. Mirrors the pattern introduced for
get_task_instances in apache#64845.

- Response schema adds next_cursor / previous_cursor and makes
  total_entries optional (populated only for offset pagination).
- Fetch limit+1 rows to detect last page and return next_cursor=null
  when no more results exist.
- Rewire the DagRuns listing page to use cursor pagination via the
  DataTable's cursorPagination prop, which eliminates the COUNT(*)
  query for large datasets.
@pierrejeambrun pierrejeambrun force-pushed the cursor-pagination-dagruns branch from b0acd8e to 22294eb Compare April 22, 2026 12:04
@pierrejeambrun pierrejeambrun marked this pull request as ready for review April 22, 2026 12:05
@pierrejeambrun pierrejeambrun added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label Apr 22, 2026
@pierrejeambrun pierrejeambrun force-pushed the cursor-pagination-dagruns branch 2 times, most recently from 0b36c05 to 22294eb Compare April 22, 2026 13:26
@pierrejeambrun pierrejeambrun merged commit c57abb9 into apache:main Apr 23, 2026
140 of 141 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

potiuk pushed a commit that referenced this pull request Apr 26, 2026
…5604)

* Add cursor based pagination for get_dag_runs endpoint

Add cursor-based (keyset) pagination as an alternative to offset-based
pagination on the get_dag_runs endpoint. Offset pagination remains the
default and is not deprecated. Mirrors the pattern introduced for
get_task_instances in #64845.

- Response schema adds next_cursor / previous_cursor and makes
  total_entries optional (populated only for offset pagination).
- Fetch limit+1 rows to detect last page and return next_cursor=null
  when no more results exist.
- Rewire the DagRuns listing page to use cursor pagination via the
  DataTable's cursorPagination prop, which eliminates the COUNT(*)
  query for large datasets.

* Small Adjustments

* Small Adjustments
(cherry picked from commit c57abb9)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
potiuk pushed a commit that referenced this pull request Apr 26, 2026
…5604) (#65746)

* Add cursor based pagination for get_dag_runs endpoint

Add cursor-based (keyset) pagination as an alternative to offset-based
pagination on the get_dag_runs endpoint. Offset pagination remains the
default and is not deprecated. Mirrors the pattern introduced for
get_task_instances in #64845.

- Response schema adds next_cursor / previous_cursor and makes
  total_entries optional (populated only for offset pagination).
- Fetch limit+1 rows to detect last page and return next_cursor=null
  when no more results exist.
- Rewire the DagRuns listing page to use cursor pagination via the
  DataTable's cursorPagination prop, which eliminates the COUNT(*)
  query for large datasets.

* Small Adjustments

* Small Adjustments
(cherry picked from commit c57abb9)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 27, 2026
…5604) (#65746)

* Add cursor based pagination for get_dag_runs endpoint

Add cursor-based (keyset) pagination as an alternative to offset-based
pagination on the get_dag_runs endpoint. Offset pagination remains the
default and is not deprecated. Mirrors the pattern introduced for
get_task_instances in #64845.

- Response schema adds next_cursor / previous_cursor and makes
  total_entries optional (populated only for offset pagination).
- Fetch limit+1 rows to detect last page and return next_cursor=null
  when no more results exist.
- Rewire the DagRuns listing page to use cursor pagination via the
  DataTable's cursorPagination prop, which eliminates the COUNT(*)
  query for large datasets.

* Small Adjustments

* Small Adjustments
(cherry picked from commit c57abb9)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…5604) (#65746)

* Add cursor based pagination for get_dag_runs endpoint

Add cursor-based (keyset) pagination as an alternative to offset-based
pagination on the get_dag_runs endpoint. Offset pagination remains the
default and is not deprecated. Mirrors the pattern introduced for
get_task_instances in #64845.

- Response schema adds next_cursor / previous_cursor and makes
  total_entries optional (populated only for offset pagination).
- Fetch limit+1 rows to detect last page and return next_cursor=null
  when no more results exist.
- Rewire the DagRuns listing page to use cursor pagination via the
  DataTable's cursorPagination prop, which eliminates the COUNT(*)
  query for large datasets.

* Small Adjustments

* Small Adjustments
(cherry picked from commit c57abb9)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants