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

Add schema utility functions #378

Merged
merged 4 commits into from
Oct 4, 2023
Merged

Add schema utility functions #378

merged 4 commits into from
Oct 4, 2023

Conversation

jsheunis
Copy link
Member

@jsheunis jsheunis commented Oct 4, 2023

This PR:

This removes 'name' from the list of required fields of the dataset schema
and adds 'metadata_sources' to the list of required fields of both the
dataset and file schemas
This adds the 'schema_utils' module that provides functionality for:
- getting an empty dict with the exact structure of one of the schemas
of a catalog (specific to a catalog or to the package itself)
- getting a valid metadata item of type 'file' or 'dataset' with the
minimum required fields, and populating these fields via arguments
@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2023

Codecov Report

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

Comparison is base (8be6ec8) 86.19% compared to head (ba656ce) 86.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #378      +/-   ##
==========================================
+ Coverage   86.19%   86.22%   +0.02%     
==========================================
  Files          43       45       +2     
  Lines        2709     2794      +85     
==========================================
+ Hits         2335     2409      +74     
- Misses        374      385      +11     
Flag Coverage Δ
unittests 79.31% <91.01%> (+0.24%) ⬆️

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

Files Coverage Δ
datalad_catalog/constants.py 100.00% <100.00%> (ø)
datalad_catalog/tests/test_add.py 100.00% <100.00%> (ø)
datalad_catalog/tests/test_schema_utils.py 100.00% <100.00%> (ø)
datalad_catalog/translate.py 85.18% <ø> (ø)
datalad_catalog/utils.py 80.31% <100.00%> (+0.64%) ⬆️
datalad_catalog/schema_utils.py 87.87% <87.87%> (ø)

... and 1 file with indirect coverage changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants