Skip to content

Client.get_items has surprising recursive behaviour when using the /search endpoint #798

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

Open
mishaschwartz opened this issue May 14, 2025 · 0 comments · May be fixed by #799
Open

Client.get_items has surprising recursive behaviour when using the /search endpoint #798

mishaschwartz opened this issue May 14, 2025 · 0 comments · May be fixed by #799

Comments

@mishaschwartz
Copy link

The Client.get_items function may get items using the /search endpoint if the server conforms to the ITEM_SEARCH conformance class.

If it does so, the search is always recursive (looks for items in sub-catalogs and sub-collections) even if the recursive=False argument is passed.

I would expect that it would make a non-recursive search instead and only return items that are the immediate child of the current catalog.

Note that the spec recommends that items have a collection as a parent (not a catalog) but catalog parents of items are supported:

Additionally, some APIs require that the collections argument be used when using the /search endpoint. This means that this

search = self.search(ids=ids)

will always raise an APIError for these APIs. This is notably the case for the STAC API at https://planetarycomputer.microsoft.com/api/stac/v1/ which is used in the tests for pystac-client.

@mishaschwartz mishaschwartz linked a pull request May 14, 2025 that will close this issue
3 tasks
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 a pull request may close this issue.

1 participant