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

Fix issues with asset HREFs #34

Merged
merged 7 commits into from
Jan 15, 2021
Merged

Fix issues with asset HREFs #34

merged 7 commits into from
Jan 15, 2021

Conversation

lossyrob
Copy link
Member

This PR adds changes to address the issues brought up in #30 and #31:

  • Upgrades to PySTAC 0.5.4, which has a change that now modifies the asset HREF the same way as link HREFs based on Catalog Type - if ABSOLUTE_PUBLISHED, the asset hrefs will be absolute. If RELATIVE_PUBLISHED or SELF_CONTAINED, the asset HREFs will be relative if they possible (e.g. if they are both on the local filesystem). This addresses stac copy with SELF_CONTAINED still has absolute links for assets #31
  • Fixes a typo that was causing exception described in Issues with move-assets command #30
  • Fixes the Error: Missing argument 'CATALOG_PATH'. error which was being caused by a flag missing the click is_flag=True parameter
  • Fixes an issue where move-assets wasn't being saved. It also removes the "--href-type" option from move-assets, as the catalog type now dictates whether asset hrefs are absolute or relative. This addresses the final point in Issues with move-assets command #30

Fixes #30
Fixes #31

In PySTAC 0.5.4, the asset HREFs are either relative or absolute
depending on their catalog type. This removes the need for users to
set the href_type for the assets themselves.
@codecov-io
Copy link

codecov-io commented Jan 15, 2021

Codecov Report

Merging #34 (5078168) into master (d8269bf) will increase coverage by 1.12%.
The diff coverage is 85.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
+ Coverage   71.83%   72.96%   +1.12%     
==========================================
  Files          35       35              
  Lines         742      736       -6     
==========================================
+ Hits          533      537       +4     
+ Misses        209      199      -10     
Impacted Files Coverage Δ
stactools_cli/stactools/cli/cli.py 0.00% <0.00%> (ø)
stactools_core/stactools/core/copy.py 78.94% <85.71%> (-0.33%) ⬇️
stactools_cli/stactools/cli/commands/copy.py 100.00% <100.00%> (+39.13%) ⬆️
stactools_core/stactools/core/merge.py 52.00% <100.00%> (ø)

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 d8269bf...5078168. Read the comment docs.

@lossyrob lossyrob merged commit 8395ac0 into master Jan 15, 2021
@lossyrob lossyrob deleted the fix/make_assets_relative branch January 15, 2021 03:44
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.

stac copy with SELF_CONTAINED still has absolute links for assets Issues with move-assets command
2 participants