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

Remove troublesome assertion #549

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Jun 23, 2023

Related Issue(s):

Description:

Couple of things going on here:

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.

PR Checklist:

  • Code is formatted
  • Tests pass
  • Changes are added to the CHANGELOG

@gadomski gadomski requested a review from jsignell June 23, 2023 17:09
@gadomski gadomski self-assigned this Jun 23, 2023
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.
@gadomski gadomski force-pushed the issues/548-stac-object-from-dict branch from d4cfd76 to b8168d8 Compare June 23, 2023 17:09
@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (1e2268d) 88.04% compared to head (b8168d8) 88.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #549      +/-   ##
==========================================
- Coverage   88.04%   88.02%   -0.02%     
==========================================
  Files          13       13              
  Lines         995      994       -1     
==========================================
- Hits          876      875       -1     
  Misses        119      119              
Impacted Files Coverage Δ
pystac_client/stac_api_io.py 91.15% <ø> (-0.08%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gadomski gadomski merged commit bfbd129 into main Jun 23, 2023
@gadomski gadomski deleted the issues/548-stac-object-from-dict branch June 23, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssertionError in stac_object_from_dict when calling item.get_collection() in 0.7.1
3 participants