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

Return existing links in pgstac #282

Merged
merged 8 commits into from
Nov 2, 2021
Merged

Return existing links in pgstac #282

merged 8 commits into from
Nov 2, 2021

Conversation

lossyrob
Copy link
Member

@lossyrob lossyrob commented Nov 1, 2021

Description:
Collections and Items stored in pgstac may have existing links. The example that uncovered this bug is for Collections to link to their licenses with rel=license link. These are currently being overwritten by the hierarchical links derived by stac-fastapi. This change passes through any non-hierarchical links in the pgstac backend.

This also changes the joplin ingest code to use a PUT if the collection or item already exists - useful for changing the development data and re-ingesting.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

Copy link
Collaborator

@moradology moradology left a comment

Choose a reason for hiding this comment

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

It looks to me as though the existing machinery for link extension should be used and updated if necessary rather than the creation of an _extended_links method

stac_fastapi/pgstac/stac_fastapi/pgstac/core.py Outdated Show resolved Hide resolved
Explain why we resolve the href for extra_links in get_links
@lossyrob lossyrob merged commit 31778fe into master Nov 2, 2021
@lossyrob lossyrob deleted the fix/rde/license-link branch November 2, 2021 14:18
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