Skip to content

fix(data-app): page through GET /apps so list finds apps beyond the first page (#798) - #803

Draft
padak wants to merge 1 commit into
mainfrom
claude/issue-798-data-app-list-pagination
Draft

padak wants to merge 1 commit into
mainfrom
claude/issue-798-data-app-list-pagination

Conversation

@padak

@padak padak commented Sep 27, 2026

Copy link
Copy Markdown
Member

What

kbagent data-app list could report "No data apps found." in a project that has data apps.

DataScienceClient.list_apps() sent one GET /apps with no query params. The Data Science API paginates that collection (default page = 100 items), and the page mixes workspace deployments (keboola.sandboxes) with data apps (keboola.data-apps). The service filters client-side, so when the first 100 deployments were all workspaces the list came back empty. In the reporter's project the first data app was item #258 of 1,114.

Fix (client layer only)

  • list_apps() now pages with limit / offset until it gets a short (or empty) page, and returns the full collection. Both callers (DataAppService.list_data_apps and the sync engine's data-app type lookup in services/_sync_data_app.py) get the complete list with no change on their side.
  • New constants in constants.py: DATA_SCIENCE_APPS_PAGE_SIZE = 500 (the page size the reporter verified) and DATA_SCIENCE_APPS_MAX_PAGES = 200. The page cap only stops an infinite loop if a server ignores offset; hitting it logs a warning.
  • The {"data": [...]} wrapped response shape is still accepted.
  • Gotcha entry in gotchas.md, tagged (since vNEXT, #798). No version bump, no changelog entry.

How tested

  • New pytest-httpx client tests (TestListAppsPaginationClient in tests/test_data_app_service.py):
    • a single short page sends exactly one request with limit=500&offset=0
    • a full page of sandboxes followed by a page containing data apps: those data apps are returned, and the exact limit/offset params are checked
    • an exactly-full last page is followed by one empty-page request
    • the wrapped {"data": [...]} shape works
    • the page cap stops a server that ignores offset
  • A service test (TestDataAppListFiltersWorkspaces): 300 sandboxes plus 1 data app, and only the data app is listed.
  • make check: 6908 passed, 15 skipped. Lint, format, ty and the doc/version gates are green.
  • Not verified against a live project with more than 100 deployments.

Fixes #798

…irst page (#798)

DataScienceClient.list_apps() issued a single GET /apps and got only the
server's default first page (100 items), which mixes workspace deployments
with data apps. Callers filter client-side, so a project with many
workspaces reported "No data apps found." It now pages with limit/offset
(DATA_SCIENCE_APPS_PAGE_SIZE) until a short page, with a page cap guarding
against a server that ignores offset.

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.

data-app list returns no apps when the first /apps page holds only workspaces (no pagination)

1 participant