Skip to content

Commit 3c02e58

Browse files
dchandangadomski
andauthored
Fix to logic determining if context.matched in response (#646)
* fix to logic determining if context.matched in response * Update changelog * Update CHANGELOG.md * pre-commit formatting for #646 --------- Co-authored-by: Pete Gadomski <[email protected]>
1 parent 53c0731 commit 3c02e58

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
- Fix to logic determining if `context.matched` in `ItemSearch.matched` response [#646](https://github.com/stac-utils/pystac-client/pull/646)
11+
1012
### Fixed
1113

1214
- Recursion error in `get_items` [#608](https://github.com/stac-utils/pystac-client/pull/608)

pystac_client/item_search.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def matched(self) -> Optional[int]:
671671
resp = self._stac_io.read_json(self.url, method=self.method, parameters=params)
672672
found = None
673673
if "context" in resp:
674-
found = resp["context"]["matched"]
674+
found = resp["context"].get("matched", None)
675675
elif "numberMatched" in resp:
676676
found = resp["numberMatched"]
677677
if found is None:

0 commit comments

Comments
 (0)