Skip to content
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

Fix get_items without ids #579

Merged
merged 3 commits into from
Aug 21, 2023
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Updated `get_items` signatures for PySTAC v1.8 [#559](https:/stac-utils/pystac-client/pull/559)
- Updated `get_items` signatures for PySTAC v1.8 [#559](https:/stac-utils/pystac-client/pull/559), [#579](https:/stac-utils/pystac-client/pull/579)

## [v0.7.2] - 2023-06-23

Expand Down
17 changes: 11 additions & 6 deletions pystac_client/item_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,18 @@ def _format(c: Any) -> Collections:

@staticmethod
def _format_ids(value: Optional[IDsLike]) -> Optional[IDs]:
if value is None:
if value is None or isinstance(value, (tuple, list)) and not value:
# We can't just check for truthiness here because of the Iterator[str] case
return None

if isinstance(value, str):
return tuple(value.split(","))

return tuple(value)
elif isinstance(value, str):
# We could check for str in the first branch, but then we'd be checking
# for str twice #microoptimizations
if value:
return tuple(value.split(","))
else:
return None
else:
return tuple(value)

def _format_sortby(self, value: Optional[SortbyLike]) -> Optional[Sortby]:
if value is None:
Expand Down
Loading
Loading