Skip to content

Missing href in zipped asset #26

@emmanuelmathot

Description

@emmanuelmathot

in some items in the STAC catalog, the zipped_product asset does not have an href. eg. https://stac.core.eopf.eodc.eu/collections/sentinel-2-l2a/items/S2C_MSIL2A_20250831T112131_N0511_R037_T30UXB_20250831T145112.

This leads to the impossibility to use pystac client and is quite blocking for data pipeline:

File ~/Workspace/eopf-explorer/data-pipeline/.venv/lib/python3.13/site-packages/pystac/item.py:468, in Item.from_dict(cls, d, href, root, migrate, preserve_dict)
    455 # get all the fields that are not passed through, parsed, or excluded
    456 extra_fields = {
    457     k: v
    458     for k, v in d.items()
    459     if k not in [*pass_through_fields, *parse_fields, *exclude_fields]
    460 }
    462 item = cls(
    463     **{k: d.get(k) for k in pass_through_fields},  # type: ignore
    464     datetime=datetime,
    465     properties=properties,
    466     extra_fields=extra_fields,
    467     href=href,
--> [468](https://file+.vscode-resource.vscode-cdn.net/home/emathot/Workspace/eopf-explorer/data-pipeline/operator-tools/~/Workspace/eopf-explorer/data-pipeline/.venv/lib/python3.13/site-packages/pystac/item.py:468)     assets={k: Asset.from_dict(v) for k, v in assets.items()},
    469 )
    471 for link in links:
    472     if href is None or link.get("rel", None) != RelType.SELF:

File ~/Workspace/eopf-explorer/data-pipeline/.venv/lib/python3.13/site-packages/pystac/asset.py:200, in Asset.from_dict(cls, d)
    194 """Constructs an Asset from a dict.
    195 
    196 Returns:
    197     Asset: The Asset deserialized from the JSON dict.
    198 """
    199 d = copy(d)
--> [200](https://file+.vscode-resource.vscode-cdn.net/home/emathot/Workspace/eopf-explorer/data-pipeline/operator-tools/~/Workspace/eopf-explorer/data-pipeline/.venv/lib/python3.13/site-packages/pystac/asset.py:200) href = d.pop("href")
    201 media_type = d.pop("type", None)
    202 title = d.pop("title", None)

KeyError: 'href'

Could you please check the missing href assets and fix them. Thank you.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions