-
Notifications
You must be signed in to change notification settings - Fork 114
fix extension free-text advanced GET-q query not split by comma #849
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
base: main
Are you sure you want to change the base?
Conversation
This was made on purpose see #655 (comment) advanced might get removed anyway stac-api-extensions/freetext-search#13 cc @rhysrevans3 |
@vincentsarago What would be the recommended approach to do the |
I can see the appeal for going back to the original issue, in FYI: I also think that free-text is not recommended for items search in pgstac |
Indeed, but the In the case of basic free-text, this list wrapping is applied using the converter here: stac-fastapi/stac_fastapi/extensions/stac_fastapi/extensions/core/free_text/request.py Lines 25 to 26 in 2c8c071
However, the advanced free-text that goes through the same code-path did not use the converter, so it ends up as plain string in the |
My plan was to move rather than remove advanced search mainly to give the user more clarity on the expected behaviour of the extension. @fmigneault it would be good to get the opinion of someone who is using the advanced search on where it should be moved to (if it is moved) stac-api-extensions/freetext-search#13 |
@fmigneault I see So I think the issue is that Then we will need a fix in stac-fastapi-pgstac to handle |
@rhysrevans3 @vincentsarago |
FYI: stac-utils/stac-fastapi-pgstac#263 if/when merged, I'll back port the change and release a |
Related Issue(s):
Description:
Unlike its basic counterpart, the
q
parameter of advanced free-text extension was passed as is (plain string) to the downstream client. This lead to invalid searches.This PR fixes this by applying the same transform, which leads to the expected behavior.
Note
Both "test_search_free_text_advanced" tests fail currently, but it doesn't seem to make much sense that the literal inputs are returned as is in
response.json() == "+ocean,-coast"
, given that the client expectsq: List[str]
(https://github.com/stac-utils/stac-fastapi-pgstac/blob/d33b0f3d1d509e16fe0dfc765dc47aea6613aac8/stac_fastapi/pgstac/core.py#L57). Should those tests be adjusted?PR Checklist:
pre-commit
hooks pass locallymake test
)make docs
)