Skip to content

fix(process manager): apply limit and offset in get_jobs - #2427

Open
C1-BA-B1-F3 wants to merge 1 commit into
geopython:masterfrom
C1-BA-B1-F3:fix/jobs-limit-offset
Open

C1-BA-B1-F3 wants to merge 1 commit into
geopython:masterfrom
C1-BA-B1-F3:fix/jobs-limit-offset

Conversation

@C1-BA-B1-F3

Copy link
Copy Markdown
Contributor

Summary

The PostgreSQL and MongoDB process managers ignored the limit and offset parameters in get_jobs, returning all jobs regardless of the query string. The TinyDB manager already applied both correctly.

This PR adds offset then limit to both backends, matching the TinyDB behaviour.

Changes

  • pygeoapi/process/manager/postgresql.py: add .offset() / .limit() to the SQLAlchemy query
  • pygeoapi/process/manager/mongodb_.py: add .skip() / .limit() to the PyMongo cursor

Test plan

  • pytest tests/manager/test_manager.py — 4/4 pass
  • pytest tests/manager/test_tinydb_manager_for_parallel_requests.py — 1/1 pass
  • PostgreSQL integration tests require a live database and were not run locally; the change is confined to the query builder and mirrors the existing TinyDB pattern.

Fixes #2426

PostgreSQL and MongoDB managers ignored the limit and offset
parameters, returning all jobs regardless of the query string.

Apply offset before limit in both backends, matching the existing
TinyDB behaviour.

Fixes geopython#2426
@C1-BA-B1-F3

Copy link
Copy Markdown
Contributor Author

The Build failure is in test_describe_collections (assert 9 == 10) and test_get_collection_edr_query (HTTP 500), both of which also fail on the current master branch (see the 2026-09-29 templating branch run). These are pre-existing upstream regressions unrelated to this process-manager change.

The two failing tests exercise /collections and EDR queries; this PR only touches pygeoapi/process/manager/postgresql.py and pygeoapi/process/manager/mongodb_.py (the get_jobs methods). No collection or EDR code is modified.

Happy to rebase once upstream fixes the CI environment.

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.

the query parameter limit is not working for jobs

1 participant