Skip to content
Snippets Groups Projects
Commit 5b0dfc97 authored by Cresson Remi's avatar Cresson Remi
Browse files

Merge branch 'no_null_values' into 'main'

enh: avoid null values dumping when apply md

See merge request umr-tetis/stac/extensions/pydantic-pystac-extensions!6
parents 88a04ab6 b9a890d0
No related branches found
Tags 0.1.6
1 merge request!6enh: avoid null values dumping when apply md
Pipeline #295315 passed
......@@ -2,4 +2,4 @@
from .core import create_extension_cls, BaseExtensionModel # noqa
__version__ = "0.1.5"
__version__ = "0.1.6"
......@@ -72,7 +72,8 @@ def create_extension_cls(model_cls: BaseModel, schema_uri: str) -> PropertiesExt
md = md or model_cls(**kwargs)
for key, value in md.model_dump(exclude_unset=True).items():
alias = model_cls.model_fields[key].alias or key
self._set_property(alias, value, pop_if_none=False)
if value:
self._set_property(alias, value, pop_if_none=False)
@classmethod
def get_schema_uri(cls) -> str:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment