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

Collection link should be resolved with root #1171

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Jun 23, 2023

Related Issue(s):

Description:

When resolving an item's collection link, we should pass the item's root into resolve_stac_object. This situation can come up when bouncing around a STAC API, where you don't always have a full tree built up in your cache.

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@gadomski gadomski added this to the 1.8 milestone Jun 23, 2023
@gadomski gadomski requested a review from jsignell June 23, 2023 15:51
@gadomski gadomski self-assigned this Jun 23, 2023
@gadomski gadomski force-pushed the resolve-collection-with-root branch from 4155939 to 2164af1 Compare June 23, 2023 15:52
@codecov
Copy link

codecov bot commented Jun 23, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (568c3af) 91.99% compared to head (2164af1) 91.99%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1171    /-   ##
=======================================
  Coverage   91.99%   91.99%           
=======================================
  Files          51       51           
  Lines        6792     6792           
  Branches     1000     1000           
=======================================
  Hits         6248     6248           
  Misses        368      368           
  Partials      176      176           
Impacted Files Coverage Δ
pystac/item.py 93.98% <100.00%> (ø)

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

gadomski added a commit to stac-utils/pystac-client that referenced this pull request 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 added a commit to stac-utils/pystac-client that referenced this pull request 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 added a commit to stac-utils/pystac-client that referenced this pull request 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.
Copy link
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gadomski gadomski added this pull request to the merge queue Jun 23, 2023
Merged via the queue into main with commit 80201b7 Jun 23, 2023
@gadomski gadomski deleted the resolve-collection-with-root branch June 23, 2023 21:33
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.

2 participants