Skip to content

Modify Item set_self_href to ensure asset HREFs do not break. #226

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

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

lossyrob
Copy link
Member

Previous to this change, using set_self_href on Item could cause assets with relative HREFs to lose a pointer to the actual asset files. This was not true in the case of using normalize_hrefs on a catalog containing the item, but calling set_self_href directly on the item could cause this problem to occur. This change moves the logic to ensure relative asset HREFs do not break when changing the Item's HREF into an overridden version of set_self_href on Item.

Previous to this change, using set_self_href on Item could cause
assets with relative HREFs to lose a pointer to the actual asset
files. This was not true in the case of using nomralize_hrefs on a
catalog containing the item, but calling set_self_href directly on the
item could cause this problem to occur. This change moves the logic to
ensure relative asset HREFs do not break when changing the Item's HREF
into an overridden version of set_self_href on Item.
@codecov-io
Copy link

Codecov Report

Merging #226 into develop will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #226   +/-   ##
========================================
  Coverage    93.23%   93.24%           
========================================
  Files           29       29           
  Lines         3578     3581    +3     
========================================
+ Hits          3336     3339    +3     
  Misses         242      242           
Impacted Files Coverage Δ
pystac/catalog.py 94.95% <100.00%> (-0.12%) ⬇️
pystac/item.py 96.60% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf5cc3d...c644d0e. Read the comment docs.

@lossyrob lossyrob merged commit 47beac2 into develop Oct 29, 2020
@lossyrob lossyrob deleted the feature/rde/item-set-self-href branch October 29, 2020 19:36
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