Skip to content

Commit

Permalink
simpler solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariana Barzinpour committed Sep 3, 2024
1 parent 85eab26 commit 3810cc4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions odc/stac/eo3/_eo3converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _item_to_ds(
if cfg is None:
cfg = {}

md: RasterCollectionMetadata = getattr(product, "_md")
md: RasterCollectionMetadata = getattr(product, "_md", None)
uuid_cfg = cfg.get("uuid", {})
ds_uuid = _compute_uuid(
item, mode=uuid_cfg.get("mode", "auto"), extras=uuid_cfg.get("extras", [])
Expand Down Expand Up @@ -321,10 +321,6 @@ def stac2ds(
if product is None:
product = infer_dc_product(item, cfg)
products[collection_id] = product
# if product_cache was provided, the products within may not have the custom _md attr
if not hasattr(product, "_md"): # pylint: disable=protected-access
md = extract_collection_metadata(item, cfg)
setattr(product, "_md", md) # pylint: disable=protected-access

yield _item_to_ds(item, product, cfg)

Expand Down

0 comments on commit 3810cc4

Please sign in to comment.