Skip to content

Commit

Permalink
Fix to logic determining if context.matched in response (#646)
Browse files Browse the repository at this point in the history
* fix to logic determining if context.matched in response

* Update changelog

* Update CHANGELOG.md

* pre-commit formatting for #646

---------

Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
  • Loading branch information
dchandan and gadomski committed Feb 28, 2024
1 parent 53c0731 commit 3c02e58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

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

### Fixed

- Recursion error in `get_items` [#608](https://github.com/stac-utils/pystac-client/pull/608)
Expand Down
2 changes: 1 addition & 1 deletion pystac_client/item_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def matched(self) -> Optional[int]:
resp = self._stac_io.read_json(self.url, method=self.method, parameters=params)
found = None
if "context" in resp:
found = resp["context"]["matched"]
found = resp["context"].get("matched", None)
elif "numberMatched" in resp:
found = resp["numberMatched"]
if found is None:
Expand Down

0 comments on commit 3c02e58

Please sign in to comment.