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

[ENH] partially validate local node JSON config #43

Merged
merged 12 commits into from
Dec 14, 2023
Merged

[ENH] partially validate local node JSON config #43

merged 12 commits into from
Dec 14, 2023

Conversation

surchs
Copy link
Contributor

@surchs surchs commented Dec 7, 2023

Changes proposed in this pull request:

  • define schema for input JSON that works with both single nodes and JSON array
  • check that the input json fits the schema
  • filter the parts of the JSON that fit the schema and discard the rest
  • return the list of things that didn't fit the schema (no explicit test yet)

Checklist

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see https://neurobagel.org/contributing/pull_requests for more info)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

@coveralls
Copy link
Collaborator

coveralls commented Dec 7, 2023

Pull Request Test Coverage Report for Build 7213419581

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 77 of 77 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 98.731%

Totals Coverage Status
Change from base Build 7091883393: 0.4%
Covered Lines: 389
Relevant Lines: 394

💛 - Coveralls

@alyssadai alyssadai self-requested a review December 8, 2023 20:27
Copy link
Contributor

@alyssadai alyssadai left a comment

Choose a reason for hiding this comment

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

Very cool use of jsonschema validation here @surchs!

Left a few 🍒 for your consideration; otherwise good to go!

app/api/utility.py Outdated Show resolved Hide resolved
app/api/utility.py Outdated Show resolved Hide resolved
app/api/utility.py Outdated Show resolved Hide resolved
app/api/utility.py Outdated Show resolved Hide resolved
surchs and others added 9 commits December 14, 2023 11:57
Co-authored-by: Alyssa Dai <alyssa.ydai@gmail.com>
Co-authored-by: Alyssa Dai <alyssa.ydai@gmail.com>
Co-authored-by: Alyssa Dai <alyssa.ydai@gmail.com>
mainly to check locally pre-commit
because I didn't have it installed
No longer can I get away without having pre-commit installed.
A good day.
@surchs surchs merged commit 1d76389 into main Dec 14, 2023
5 checks passed
@surchs surchs deleted the issue31 branch December 14, 2023 19:09
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.

Raise warning when contents of local_nb_nodes.json aren't valid
3 participants