From 0be3c4abfb001bb8b144a46bdf9fbfa76be8cd4e Mon Sep 17 00:00:00 2001 From: Richard Bruskiewich Date: Fri, 3 Nov 2023 11:03:25 -0700 Subject: [PATCH] bug fix in _construct_target_class() **`BaseModel.parse_obj()`** appears to only need to get a dictionary as its argument, not **kwargs from the 'x' dictionary object --- linkml_runtime/loaders/loader_root.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linkml_runtime/loaders/loader_root.py b/linkml_runtime/loaders/loader_root.py index 221069ef..5fdd1e41 100644 --- a/linkml_runtime/loaders/loader_root.py +++ b/linkml_runtime/loaders/loader_root.py @@ -122,7 +122,7 @@ def _construct_target_class(self, if issubclass(target_class, YAMLRoot): return [target_class(**as_dict(x)) for x in data_as_dict] elif issubclass(target_class, BaseModel): - return [target_class.parse_obj(**as_dict(x)) for x in data_as_dict] + return [target_class.parse_obj(as_dict(x)) for x in data_as_dict] else: raise ValueError(f'Cannot load list of {target_class}') elif isinstance(data_as_dict, dict): @@ -153,4 +153,4 @@ def _read_source(self, else: data = source - return data \ No newline at end of file + return data