stac-utils/pystac-client

url_with_parameters omiting query filter values

loicdtx opened this issue · 4 comments

Any filter search passed via query= appears to be stripped off the url returned by the url_with_parameters method. See example below.

from pystac_client.item_search import ItemSearch

search = ItemSearch(
    url="https://planetarycomputer.microsoft.com/api/stac/v1/search",
    collections=["sentinel-2-l2a"],
    bbox=[88.214, 27.927, 88.302, 28.034],
    query={"eo:cloud_cover": {"lt": 10}}
)
search.url_with_parameters()
# 'https://planetarycomputer.microsoft.com/api/stac/v1/search?limit=100&bbox=88.214,27.927,88.302,28.034&collections=sentinel-2-l2a&query=eo:cloud_cover'

@loicdtx I was not able to reproduce, see #530 for a test case.

Perhaps this help reproducibility

docker run --rm -it python:3 sh -c "pip install pystac-client && python -c 'from pystac_client.item_search import ItemSearch; search = ItemSearch(url=\"https://planetarycomputer.microsoft.com/api/stac/v1/search\", collections=[\"sentinel-2-l2a\"], bbox=[88.214, 27.927, 88.302, 28.034], query={\"eo:cloud_cover\": {\"lt\": 10}}); print(search.url_with_parameters())'"

Ah, I see ... your issue was fixed by #362 which isn't released yet. We're hoping to get v0.7.0 out today (https://github.com/stac-utils/pystac-client/milestone/11) which will fix your issue. Thanks for the report and sorry about the confusion!

Great ! And good to know that issue with GET has been addressed already; I had it in my stash but haven't had time to file a proper bug report.