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

[FIX] Allow only "true" or None for is_control query parameter #364

Merged
merged 9 commits into from
Oct 24, 2024

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Oct 24, 2024

Changes proposed in this pull request:

  • is_control query param now accepts str, with allowed values being either "true" (case-insensitive) or None via custom validation
    • str used b/c using Literal to enforce allowed values of True or None doesn't play well in a query parameter (see comment in code)
    • "true" values transformed to boolean internally
  • SPARQL query now only adds filter if is_control=True in query

Note: the default SPARQL query file hasn't changed in this case b/c it assumes no filters are applied

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass
  • If the PR changes the SPARQL query template, the default Neurobagel query file has also been regenerated

For new features:

  • Tests have been added

For bug fixes:

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

@alyssadai alyssadai added the pr-bug-fix Bug fix, will increment patch version when merged (0.0.+1) label Oct 24, 2024
@coveralls
Copy link
Collaborator

coveralls commented Oct 24, 2024

Pull Request Test Coverage Report for Build 11505364023

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 18 of 19 (94.74%) changed or added relevant lines in 3 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 95.572%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/api/utility.py 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
tests/test_query.py 3 98.34%
Totals Coverage Status
Change from base Build 11483707011: -0.03%
Covered Lines: 777
Relevant Lines: 813

💛 - Coveralls

@alyssadai alyssadai marked this pull request as ready for review October 24, 2024 05:03
@rmanaem rmanaem self-requested a review October 24, 2024 15:17
@alyssadai alyssadai added the release Create a release when this PR is merged label Oct 24, 2024
Copy link
Collaborator

@rmanaem rmanaem left a comment

Choose a reason for hiding this comment

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

🧑‍🍳

@alyssadai alyssadai changed the title [FIX] Allow only true or None for is_control query parameter [FIX] Allow only "true" or None for is_control query parameter Oct 24, 2024
@alyssadai alyssadai merged commit b03e89f into main Oct 24, 2024
8 checks passed
@alyssadai alyssadai deleted the constrain-is-control-query branch October 24, 2024 19:35
Copy link
Contributor

🚀 PR was released in v0.4.0 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bug-fix Bug fix, will increment patch version when merged (0.0.+1) release Create a release when this PR is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queries for is_control=False no longer work with restriction against unbound variables
3 participants