Skip to content
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

mapping loading with mapping type specified or different method name #344

Merged
merged 11 commits into from
Oct 19, 2023

Conversation

ssssarah
Copy link
Contributor

@ssssarah ssssarah commented Oct 12, 2023

Adresses #332

I guess the real issue is that a mapping may be a url, txt or a file path, and if it was neither a url (= couldn't request it) or a filepath (= couldn't load the file), then it was assumed to be a txt mapping. But it could have been intended to be a url but malformed, or a filepath but malformed.
Maybe some validation that whatever string is passed is meant to be a text mapping should be done. I've put a hack of a check that it should start with a {, but I'm not even sure this is true of all text mappings.

Update: in checking the validity of the mapping str provided, it brought out that many current mappings in tests are not valid paths, and the failure to load them was silent and did not make the tests fail

@ssssarah ssssarah force-pushed the mapping_update branch 3 times, most recently from b51c22e to a62c5ab Compare October 13, 2023 09:02
@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (ee54140) 73.45% compared to head (7d677cc) 73.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #344      +/-   ##
==========================================
+ Coverage   73.45%   73.87%   +0.41%     
==========================================
  Files          91       92       +1     
  Lines        5831     5913      +82     
==========================================
+ Hits         4283     4368      +85     
+ Misses       1548     1545       -3     
Flag Coverage Δ
unittests 73.87% <91.42%> (+0.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
tests/conftest.py 98.98% <100.00%> (ø)
tests/specializations/mappings/test_mappings.py 100.00% <100.00%> (ø)
tests/specializations/models/test_demo_model.py 100.00% <100.00%> (ø)
tests/specializations/models/test_rdf_model.py 100.00% <100.00%> (ø)
...sts/specializations/stores/test_bluebrain_nexus.py 93.90% <100.00%> (+0.03%) ⬆️
utils.py 33.33% <100.00%> (+33.33%) ⬆️
kgforge/specializations/mappings/dictionaries.py 90.00% <85.71%> (-2.31%) ⬇️
kgforge/core/archetypes/store.py 59.36% <75.00%> (+0.37%) ⬆️
kgforge/specializations/stores/demo_store.py 39.41% <75.00%> (+0.99%) ⬆️
kgforge/core/archetypes/mapping.py 81.69% <90.24%> (+11.69%) ⬆️

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

@ssssarah ssssarah requested a review from MFSY October 13, 2023 12:16
@ssssarah ssssarah self-assigned this Oct 13, 2023
@ssssarah ssssarah requested a review from crisely09 October 16, 2023 16:08
@crisely09 crisely09 self-requested a review October 19, 2023 10:04
Copy link
Contributor

@crisely09 crisely09 left a comment

Choose a reason for hiding this comment

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

Looks good

@ssssarah ssssarah merged commit f51c9ec into master Oct 19, 2023
1 check passed
@ssssarah ssssarah deleted the mapping_update branch October 20, 2023 12:40
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.

3 participants