The GitHub Actions job "Tests (AMD)" on airflow.git/backport-3b13e59-v3-3-test 
has failed.
Run started by GitHub user vatsrahul1001 (triggered by vatsrahul1001).

Head commit for run:
a480271c024543752a3b0d04ee0454c40916147e / Steve Ahn <[email protected]>
Fix cursor pagination dropping rows when sorting by a nullable column (#68869)

* Fix cursor pagination dropping rows when sorting by a nullable column

Cursor (keyset) paginated REST list endpoints silently dropped rows when the
sort column was nullable. The keyset predicate and the generated ORDER BY
disagreed on where NULLs sort, so once a page boundary fell on the NULL/non-NULL
edge every row on one side of it was skipped with no error. This is silent data
loss from the public API under a common sort such as start_date.

Cross-dialect NULLS FIRST/LAST is not portable (unsupported on MySQL and old
SQLite), so the cursor path now pins NULL placement with a portable CASE-based
null-rank key shared by both the keyset ORDER BY and the keyset predicate, so 
the
two can no longer disagree on any backend. The rank follows the column's sort
direction, so NULLs order as the largest value (last when ascending, first when
descending), matching PostgreSQL's default. PostgreSQL result order is therefore
unchanged; SQLite and MySQL NULL ordering shifts to align with it. The cursor
token format is unchanged (the rank is derived, not encoded) and offset
pagination is untouched.

* Add newsfragment for nullable-column cursor pagination fix

* Preserve index usage for nullable-column cursor pagination

The keyset ORDER BY ranked NULLs with a portable CASE expression so NULL
placement was uniform across backends. A computed ORDER BY key cannot use a
B-tree index, so large lists fall back to a full sort. Match each backend's
native NULL placement in the keyset predicate instead and keep the ORDER BY a
bare column, preserving the index; the fix still returns every row exactly once.
EXPLAIN on Postgres confirms an Index Only Scan rather than a Sort.

(cherry picked from commit 3b13e593ac697c5cb3dd6ded9c63e0f5c24a547a)

Report URL: https://github.com/apache/airflow/actions/runs/30531907019

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to