What's Changed
-
Mark tests requiring access to the internet by @avalentino in #187
-
switch to uv and hatch by @vincentsarago in #188
-
fix: make sure to return datetime=null event if exclude_none is set by @vincentsarago in #190
from stac_pydantic.api import Item stac_item = Item.model_validate( { "id": "12345", "type": "Feature", "stac_extensions": [], "geometry": None, "properties": { "datetime": None, "start_datetime": "2024-01-01T00:00:00Z", "end_datetime": "2024-01-02T00:00:00Z", }, "collection": "collection", "links": [ { "rel": "self", "href": "http://stac.example.com/catalog/collections/CS3-20160503_132130_04/items/CS3-20160503_132130_04.json" }, { "rel": "collection", "href": "http://stac.example.com/catalog/CS3-20160503_132130_04/catalog.json" }, { "rel": "root", "href": "http://stac.example.com/catalog" } ], "assets": {}, } ) out = stac_item.model_dump(exclude_none=True) # `geometry` is required assert out["geometry"] is None # `datetime` is a required property assert out["properties"]["datetime"] is None # force exclusion of required keys out = stac_item.model_dump(exclude_none=True, exclude={"properties": {"datetime"}, "geometry": True}) assert "geometry" not in out assert "datetime" not in out["properties"]
New Contributors
- @avalentino made their first contribution in #187
Full Changelog: 3.4.0...3.5.0