Skip to content

fix(storage): return null next_cursor on the final search page - #526

Open
chenyangsu wants to merge 1 commit into
ga4gh:mainfrom
chenyangsu:fix/search-final-page-cursor
Open

chenyangsu wants to merge 1 commit into
ga4gh:mainfrom
chenyangsu:fix/search-final-page-cursor

Conversation

@chenyangsu

Copy link
Copy Markdown
Contributor

search_alleles builds next_cursor from the last row of every non-empty page, so the final page of GET /variations still returns a cursor, and following it gives an empty page (#508).

The query now fetches page_size + 1 rows, as suggested in the issue thread, and returns next_cursor: null when no extra row comes back. The storage test now checks the final page and an exact-fit page instead of following the cursor to an empty page.

Testing: ANYVAR_TEST_STORAGE_URI="duckdb:///:memory:" pytest tests/unit/storage/test_duckdb.py tests/unit/storage/test_no_db.py (12 passed; the search test failed before); ruff check and ruff format --check clean.

Fixes #508

@chenyangsu
chenyangsu requested a review from a team as a code owner November 27, 2026 18:17
@korikuzma

Copy link
Copy Markdown
Contributor

@jsstevenson tagging you since I think you're the one that wrote this part and was going to check on how we wanted to handle

@jsstevenson

Copy link
Copy Markdown
Contributor

👍

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET /variations retuns a non-null next_cursor when no results exist

3 participants