Skip to content

Commit 6ba1b0b

Browse files
authored
Merge pull request #339 from sneakers-the-rat/fix-deprecation-warnings
Fix deprecation warning - use model_dump not dict
2 parents 9fd5a3e + e698170 commit 6ba1b0b

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)