Skip to content

STACVersionID assigned string value in migration #1506

@keithpeck

Description

@keithpeck

https://github.com/stac-utils/pystac/blob/main/pystac/serialization/identify.py#L268
I believe version_range.set_to_single(stac_version)
should be version_range.set_to_single(STACVersionID(stac_version))

This issue results in min_version and max_version being assigned strings. Later during migrations it results in bad code paths.

Image

This only occurs when the item stac_version is < STACVersion.DEFAULT_STAC_VERSION, which is why it doesn't happen during test_older_extension_version and probably wasn't common scenario until the STAC 1.1.0 update.

    item_as_dict["stac_version"] = "1.0.0"
    migrated_item = pystac.Item.from_dict(item_as_dict, migrate=True)

Does cause the issue.

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