-
Notifications
You must be signed in to change notification settings - Fork 111
Sorting/paging inconsistencies and errors #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Minor issue in script, line 64 should read: print(f"Page {page}: POST {url}: {body}") |
What version of pgstac are you running? There was a release last week that included some fixes for sorting and paging (e.g. stac-utils/pgstac#154). If you're not on v0.6.13, can you update your pgstac and see if the issue persists? Thanks! |
I was running 0.6.11. I upgraded to 0.6.13 and the result is slightly different. The syntax error for mixed ascending/descending sort no longer occurs, but when I run the test script again, the results are still inconsistent: 5 items (asc), 10 items (desc), and 6 items (asc + desc). This is the output:
|
Another thing I noticed: it seems to be consistently the case (also with larger real-life data) that when sorting in descending order that the result is correct and complete (i.e. contains no duplicates and includes the items that don't have the property used as sort criterion), as in the second request above where all 10 items are returned). And for the ascending sort, adding a second, unique sort criterion (e.g. Thanks Pete for looking into this! |
I've opened a PR with a failing test (based heavily on your example): #516. I'll work with the pgstac folks to see if we can't chase this down -- the error is probably over there. |
Confirming that #514 is fixed with pgstac v0.7.0.
Confirming that #514 is fixed with pgstac v0.7.0.
* deps: bump pgstac to v0.7.1 * ci: only build packages on main or tags * ci: don't log on services * ci: up timeout minutes * chore: update changelog * test: add sorting test Confirming that #514 is fixed with pgstac v0.7.0.
* deps: bump pgstac to v0.7.1 * ci: only build packages on main or tags * ci: don't log on services * ci: up timeout minutes * chore: update changelog * test: add sorting test Confirming that stac-utils/stac-fastapi#514 is fixed with pgstac v0.7.0.
Hello there,
I found an issue with searches, when sorting is used in combination with paging, especially when the a field that is a sort criterion is missing in some items. The result is not complete and can even be different depending on the sort order (ascending or descending). Items in the search result can even be duplicated.
The script below reproduces the problem (check the
endpoint
variable to make sure it uses the correct URL). It creates 10 very simple STAC items of which some haveeo:cloud_cover
values (with duplicates), but some items don't have that field.When making a search request for the whole collection (without filter) ordering by
eo:cloud_cover
and with a limit of 2 items per page, all 10 items should be returned (in 5 pages), but there are only 6 items (ascending sort) and 4 items (descending sort), respectively.Furthermore. when sorting by two criteria in opposed directions, the second page (with the next token) fails with an PostgreSQL syntax error.
This is the output:
Has anybody else noticed issues like these? They are more likely to be found in large heterogeneous collections that might not be typical, but I think these are problems that should be fixed.
Thank you for any feedback!
The text was updated successfully, but these errors were encountered: