Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Commit

Permalink
fix: Prevent metadata duplication
Browse files Browse the repository at this point in the history
Pystac normalize_hrefs resolves all links and mutates the entire tree, causing collection.json for all datasets to update. save_object only saves the particular entity within the catalog, preventing unnecessary metadata duplication. Fixes #1818
  • Loading branch information
Jimlinz committed Aug 4, 2022
1 parent 4843a6d commit 2d0a17b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions geostore/populate_catalog/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,4 @@ def handle_message(metadata_key: str) -> None:
if root_catalog.get_child(dataset_metadata.id) is None:
root_catalog.add_child(child=dataset_metadata, strategy=GeostoreSTACLayoutStrategy())

root_catalog.normalize_hrefs(
f"{S3_URL_PREFIX}{Resource.STORAGE_BUCKET_NAME.resource_name}",
strategy=GeostoreSTACLayoutStrategy(),
)
root_catalog.save(catalog_type=CatalogType.SELF_CONTAINED)
root_catalog.save_object()

0 comments on commit 2d0a17b

Please sign in to comment.