Skip to content

Commit 0ed2c02

Browse files
committed
Add test, update changelog
1 parent 88a2a96 commit 0ed2c02

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Expand support for previous extension schema URIs ([#1091](https://github.com/stac-utils/pystac/pull/1091))
1919
- Use `pyproject.toml` instead of `setup.py` ([#1100](https://github.com/stac-utils/pystac/pull/1100))
2020
- `DefaultStacIO` now raises an error if it tries to write to a non-local url ([#1107](https://github.com/stac-utils/pystac/pull/1107))
21+
- Allow instantiation of pystac objects even with `"stac_extensions": null` ([#1109](https://github.com/stac-utils/pystac/pull/1109))
2122

2223
### Deprecated
2324

tests/serialization/test_migrate.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,13 @@ def test_should_raise_exception_when_passing_invalid_extension_object(
9999
match=r"^Item Assets extension does not apply to type 'object'$",
100100
):
101101
ItemAssetsExtension.ext(object()) # type: ignore
102+
103+
104+
def test_migrate_works_even_if_stac_extensions_is_null(
105+
test_case_1_catalog: pystac.Catalog,
106+
) -> None:
107+
collection = list(test_case_1_catalog.get_all_collections())[0]
108+
collection_dict = collection.to_dict()
109+
collection_dict["stac_extensions"] = None
110+
111+
pystac.Collection.from_dict(collection_dict, migrate=True)

0 commit comments

Comments
 (0)