Skip to content

Commit 3810cc4

Browse files
author
Ariana Barzinpour
committed
simpler solution
1 parent 85eab26 commit 3810cc4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

odc/stac/eo3/_eo3converter.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def _item_to_ds(
238238
if cfg is None:
239239
cfg = {}
240240

241-
md: RasterCollectionMetadata = getattr(product, "_md")
241+
md: RasterCollectionMetadata = getattr(product, "_md", None)
242242
uuid_cfg = cfg.get("uuid", {})
243243
ds_uuid = _compute_uuid(
244244
item, mode=uuid_cfg.get("mode", "auto"), extras=uuid_cfg.get("extras", [])
@@ -321,10 +321,6 @@ def stac2ds(
321321
if product is None:
322322
product = infer_dc_product(item, cfg)
323323
products[collection_id] = product
324-
# if product_cache was provided, the products within may not have the custom _md attr
325-
if not hasattr(product, "_md"): # pylint: disable=protected-access
326-
md = extract_collection_metadata(item, cfg)
327-
setattr(product, "_md", md) # pylint: disable=protected-access
328324

329325
yield _item_to_ds(item, product, cfg)
330326

0 commit comments

Comments
 (0)