Skip to content

Commit 5fae268

Browse files
authored
Fix fields argument to CLI (#797)
* Split fields coming from CLI * Add a test * Update changelog
1 parent 9280bea commit 5fae268

File tree

4 files changed

+149
-1
lines changed

4 files changed

+149
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Fixed
1111

1212
- Fix usage documentation of `ItemSearch`
13+
- Fix fields argument to CLI ([#797](https://github.com/stac-utils/pystac-client/pull/797))
1314

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

pystac_client/item_search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ def __init__(
159159

160160
self.method = method
161161
self.modifier = modifier
162-
163162
params = {
164163
"limit": limit,
165164
"bbox": self._format_bbox(bbox),
@@ -482,6 +481,8 @@ def _format_fields(self, value: FieldsLike | None) -> Fields | None:
482481
if isinstance(value, str):
483482
return self._fields_to_dict(value.split(","))
484483
if isinstance(value, list):
484+
if len(value) == 1:
485+
return self._fields_to_dict(value[0].split(","))
485486
return self._fields_to_dict(value)
486487
if isinstance(value, dict):
487488
return value

0 commit comments

Comments
 (0)