8000 fix get items recursive documentation by mishaschwartz · Pull Request #800 · stac-utils/pystac-client · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix get items recursive documentation 8000 #800

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
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Fix usage documentation of `ItemSearch`
- Fix fields argument to CLI ([#797](https://github.com/stac-utils/pystac-client/pull/797))
- Clarify recursive behaviour of the `get_items` method in the method docstring ([#800](https://github.com/stac-utils/pystac-client/pull/800))

## [v0.8.6] - 2025-02-11

Expand Down
18 changes: 15 additions & 3 deletions pystac_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
)
from pystac_client.mixins import QUERYABLES_ENDPOINT, QueryablesMixin
from pystac_client.stac_api_io import StacApiIO, Timeout
from pystac_client.warnings import DoesNotConformTo, FallbackToPystac, NoConformsTo
from pystac_client.warnings import (
DoesNotConformTo,
FallbackToPystac,
NoConformsTo,
PystacClientWarning,
)

if TYPE_CHECKING:
from pystac.item import Item as Item_Type
Expand Down Expand Up @@ -450,13 +455,20 @@ def get_items(

Args:
ids: Zero or more item ids to find.
recursive: unused in pystac-client, but needed for falling back to pystac

recursive: If this client conforms to the ITEM_SEARCH conformance class,
this is unused and this will always yield items recursively.
Otherwise, this will only return items recursively if True or None.
Return:
Iterator[Item]: Iterator of items whose parent is this
catalog.
"""
if self.conforms_to(ConformanceClasses.ITEM_SEARCH):
if recursive is False:
warnings.warn(
"Getting items recursively using the /search endpoint "
"(the recursive argument is being ignored).",
PystacClientWarning,
)
search = self.search(ids=ids)
yield from search.items()
else:
Expand Down
0