Skip to content

Conversation

@christian-monch
Copy link

This commit fixes a problem that was discovered when using linkml-convert to convert JSON to TTL using the schema: https://concepts.inm7.de/s/simpleinput/unreleased.yaml

The original code used a dictionary as the argument to the constructor of a Pydantic class, but should have used the **-operator to convert the dictionary into keyword arguments.

This commit fixes a problem that was discovered while
converting between TTL and JSON using the schema
https://concepts.inm7.de/s/simpleinput/unreleased.yaml

The original code used a dictionary as argument to
the constructor of a pydantic-class, when it should
have used the **-operator to cnvert the dictionary
into keyword arguments.
@codecov
Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 63.79%. Comparing base (b2206a4) to head (9fdcd41).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
linkml_runtime/utils/yamlutils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #392   +/-   ##
=======================================
  Coverage   63.79%   63.79%           
=======================================
  Files          63       63           
  Lines        8938     8938           
  Branches     2584     2584           
=======================================
  Hits         5702     5702           
  Misses       2629     2629           
  Partials      607      607           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# key_name:value
order_up(list_entry[lek], slot_type(list_entry))
order_up(list_entry[lek], slot_type(**list_entry))
break # Not strictly necessary, but
Copy link
Collaborator

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

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))
Copy link
Collaborator

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?

@amc-corey-cox
Copy link
Contributor

@christian-monch I have moved the work on this PR into the repo branch https://github.com/linkml/linkml-runtime/tree/fix-normalize-inlined . If you would like to continue this work please re-open the PR on the mono-repo after the merge from that branch. We'll lift it over for you so it should take less effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants