Skip to content

Add backward-walk coverage for cursor-based pagination - #71365

Merged
bbovenzi merged 1 commit into
apache:mainfrom
astronomer:add-cursor-backward-pagination-test
Aug 10, 2026
Merged

bbovenzi merged 1 commit into
apache:mainfrom
astronomer:add-cursor-backward-pagination-test

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

The keyset pagination helpers in api_fastapi/common/cursors.py are exercised only for forward paging. A regression in the backward (previous-page) path — excluding more than the boundary row, or failing to invert NULL placement when the sort direction flips — would silently truncate a page walked back into, with no test to catch it.

This adds a forward-then-backward invariant: walking backward through the pages must reproduce the forward pages in reverse, dropping nothing. It's parametrized over the cases that stress that path (equal leading values split across pages, and NULLs under both ASC and DESC).

Test-only; no behavior change.


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

Generated-by: Claude Code (Opus 4.8) following the guidelines

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Aug 10, 2026
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.2 milestone Aug 10, 2026
@pierrejeambrun
pierrejeambrun force-pushed the add-cursor-backward-pagination-test branch from 3d3ca0f to be08b3d Compare August 10, 2026 10:07
The keyset pagination helpers are exercised only for forward paging, so a
regression in the backward (previous-page) path — excluding more than the
boundary row, or failing to invert NULL placement when the sort direction
flips — would silently truncate a page walked back into, with nothing to
catch it. This closes that coverage gap.
@pierrejeambrun
pierrejeambrun force-pushed the add-cursor-backward-pagination-test branch from be08b3d to dce2faf Compare August 10, 2026 10:32
@ashb

ashb commented Aug 10, 2026

Copy link
Copy Markdown
Member

[approve]

👍🏻

@bbovenzi
bbovenzi merged commit 54018ba into apache:main Aug 10, 2026
77 checks passed
@bbovenzi
bbovenzi deleted the add-cursor-backward-pagination-test branch August 10, 2026 13:24
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-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-3-test PR Link

pierrejeambrun added a commit that referenced this pull request Aug 10, 2026
…71365) (#71376)

The keyset pagination helpers are exercised only for forward paging, so a
regression in the backward (previous-page) path — excluding more than the
boundary row, or failing to invert NULL placement when the sort direction
flips — would silently truncate a page walked back into, with nothing to
catch it. This closes that coverage gap.
(cherry picked from commit 54018ba)

Co-authored-by: Pierre Jeambrun <[email protected]>
vatsrahul1001 pushed a commit that referenced this pull request Aug 13, 2026
…71365) (#71376)

The keyset pagination helpers are exercised only for forward paging, so a
regression in the backward (previous-page) path — excluding more than the
boundary row, or failing to invert NULL placement when the sort direction
flips — would silently truncate a page walked back into, with nothing to
catch it. This closes that coverage gap.
(cherry picked from commit 54018ba)

Co-authored-by: Pierre Jeambrun <[email protected]>
vatsrahul1001 pushed a commit that referenced this pull request Sep 7, 2026
…71365) (#71376)

The keyset pagination helpers are exercised only for forward paging, so a
regression in the backward (previous-page) path — excluding more than the
boundary row, or failing to invert NULL placement when the sort direction
flips — would silently truncate a page walked back into, with nothing to
catch it. This closes that coverage gap.
(cherry picked from commit 54018ba)

Co-authored-by: Pierre Jeambrun <[email protected]>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants