diff --git a/CHANGELOG.md b/CHANGELOG.md index cb5f260..9cbc9e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed -- Deterministic asset ordering ([rustac #709](https://github.com/stac-utils/rustac/pull/709)) +- Deterministic asset ordering ([rustac #709](https://github.com/stac-utils/rustac/pull/709), [#93](https://github.com/stac-utils/rustac-py/pull/93)) ## [0.6.0] - 2025-04-18 diff --git a/Cargo.toml b/Cargo.toml index 8875d75..244a704 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ pyo3-async-runtimes = { version = "0.24.0", features = [ pyo3-arrow = "0.8.0" pythonize = "0.24.0" serde = "1.0.217" -serde_json = "1.0.138" +serde_json = { version = "1.0.138", features = ["preserve_order"] } stac = { features = [ "geoparquet-compression", "object-store-all", diff --git a/tests/test_read.py b/tests/test_read.py index baf8dca..f5004d8 100644 --- a/tests/test_read.py +++ b/tests/test_read.py @@ -7,3 +7,13 @@ async def test_read(examples: Path) -> None: item = Item.from_dict(await rustac.read(str(examples / "simple-item.json"))) item.validate() + + +async def test_asset_ordering(examples: Path) -> None: + # Not a perfect test but should be good enough for https://github.com/stac-utils/rustac-py/issues/85 + lists = [] + for _ in range(10): + item = await rustac.read(str(examples / "extended-item.json")) + lists.append(list(item["assets"].keys())) + for sublist in lists[1:]: + assert lists[0] == sublist