Skip to content

Commit

Permalink
fix: remove troublesome assertion (#549)
Browse files Browse the repository at this point in the history
Couple of things going on here:

- Without stac-utils/pystac#1171, the resolved collection won't
  have a root.
- Even with stac-utils/pystac#1171, the root will be cast to a
  `Catalog` by
  https://github.com/stac-utils/pystac/blob/9b363db07f19692d319804ccffce23b72d759839/pystac/stac_object.py#L275-L292,
  so this assertion would fail even with the preserve_dict

To fix breakages to existing code, we remove the assertion, and assume that stuff will
blow up later if the `root` isn't the correct object type.
  • Loading branch information
gadomski authored Jun 23, 2023
1 parent 1e2268d commit bfbd129
Show file tree
Hide file tree
Showing 4 changed files with 678 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Remove troublesome assertion [#549](https://github.com/stac-utils/pystac-client/pull/549)

## [v0.7.1] - 2023-06-13

### Fixed
Expand Down
1 change: 0 additions & 1 deletion pystac_client/stac_api_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def stac_object_from_dict(
return result

if info.object_type == pystac.STACObjectType.COLLECTION:
assert isinstance(root, pystac_client.client.Client)
return pystac_client.collection_client.CollectionClient.from_dict(
d, href=str(href), root=root, migrate=False, preserve_dict=preserve_dict
)
Expand Down
Loading

0 comments on commit bfbd129

Please sign in to comment.