fix(process manager): apply limit and offset in get_jobs - #2427
Open
C1-BA-B1-F3 wants to merge 1 commit into
Open
C1-BA-B1-F3 wants to merge 1 commit into
C1-BA-B1-F3 wants to merge 1 commit into
Conversation
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
Contributor
Author
|
The The two failing tests exercise Happy to rebase once upstream fixes the CI environment. |
2 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PostgreSQL and MongoDB process managers ignored the
limitandoffsetparameters inget_jobs, returning all jobs regardless of the query string. The TinyDB manager already applied both correctly.This PR adds
offsetthenlimitto both backends, matching the TinyDB behaviour.Changes
pygeoapi/process/manager/postgresql.py: add.offset()/.limit()to the SQLAlchemy querypygeoapi/process/manager/mongodb_.py: add.skip()/.limit()to the PyMongo cursorTest plan
pytest tests/manager/test_manager.py— 4/4 passpytest tests/manager/test_tinydb_manager_for_parallel_requests.py— 1/1 passFixes #2426