Skip to content

Commit e698170

Browse files
use model_dump not dict
1 parent 9fd5a3e commit e698170

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linkml_runtime/dumpers/yaml_dumper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def dumps(self, element: Union[BaseModel, YAMLRoot], **kwargs) -> str:
1313
# Internal note: remove_empty_items will also convert Decimals to int/float;
1414
# this is necessary until https://github.com/yaml/pyyaml/pull/372 is merged
1515

16-
dumper_safe_element = element.dict() if isinstance(element, BaseModel) else element
16+
dumper_safe_element = element.model_dump() if isinstance(element, BaseModel) else element
1717
return yaml.dump(remove_empty_items(dumper_safe_element, hide_protected_keys=True),
1818
Dumper=yaml.SafeDumper, sort_keys=False,
1919
allow_unicode=True,

0 commit comments

Comments
 (0)