Skip to content

Respect result limits in paginated tool, service and variable queries - #131

Open
r4venrudy wants to merge 1 commit into
nasa:developfrom
r4venrudy:fix/paginated-get-limit
Open

r4venrudy wants to merge 1 commit into
nasa:developfrom
r4venrudy:fix/paginated-get-limit

Conversation

@r4venrudy

Copy link
Copy Markdown

ToolQuery.get(2001) can return 4,000 records when enough matches exist: the second 2,000-record page is appended in full. The shared implementation also affects service and variable queries.

Append only the remaining requested records from the final page. Keep page_size fixed across page_num requests, since reducing it would shift page offsets and repeat records. Add a changelog entry and 15 offline cases covering all three query classes, partial and exact page limits, exhausted results, and a zero limit.

Validation on Windows / Python 3.12:

  • Before the fix: 6 regression failures and 9 passing controls.
  • Full suite after the fix: 144 passed, with outbound socket connections blocked and existing recorded responses replayed.
  • mypy cmr tests, the CI fatal-error Flake8 checks, and git diff --check: passed.

The test environment uses the repository-locked requests 2.32.4, urllib3 2.2.3, VCR.py 6.0.1, and mypy 1.11.2. No dependency or fixture changes are included.

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.

1 participant