Skip to content

Fix object instantiation in _normalize_inlined() #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion linkml_runtime/utils/yamlutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
for lek, lev in items(list_entry):
if lek == key_name and not isinstance(lev, (list, dict, JsonObj)):
# key_name:value
order_up(list_entry[lek], slot_type(list_entry))
order_up(list_entry[lek], slot_type(**list_entry))

Check warning on line 172 in linkml_runtime/utils/yamlutils.py

View check run for this annotation

Codecov / codecov/patch

linkml_runtime/utils/yamlutils.py#L172

Added line #L172 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test that demonstrates the correctness of the fix?

break # Not strictly necessary, but
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove this line? not sure why it is in here

elif not isinstance(lev, (list, dict, JsonObj)):
# key: value --> slot_type(key, value)
Expand Down
Loading