Skip to content

Commit 0be3c4a

Browse files
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
1 parent 687fc53 commit 0be3c4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

linkml_runtime/loaders/loader_root.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def _construct_target_class(self,
122122
if issubclass(target_class, YAMLRoot):
123123
return [target_class(**as_dict(x)) for x in data_as_dict]
124124
elif issubclass(target_class, BaseModel):
125-
return [target_class.parse_obj(**as_dict(x)) for x in data_as_dict]
125+
return [target_class.parse_obj(as_dict(x)) for x in data_as_dict]
126126
else:
127127
raise ValueError(f'Cannot load list of {target_class}')
128128
elif isinstance(data_as_dict, dict):
@@ -153,4 +153,4 @@ def _read_source(self,
153153
else:
154154
data = source
155155

156-
return data
156+
return data

0 commit comments

Comments
 (0)