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

[REF] Split generic /attributes endpoints into attribute-specific routers #358

Merged
merged 9 commits into from
Oct 17, 2024

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Oct 17, 2024

Changes proposed in this pull request:

  • GET /attributes/{data_element_uri} and GET /attributes/{data_element_uri}/vocab endpoints removed
  • Added two new routers:
    • /assessments
    • /diagnoses
  • Created factory functions for the root / (i.e., get all instances in the graph) and /vocab subpaths of attribute-specific routers
  • Refactored tests of removed endpoints into a new module test_attribute_factory_routes.py
  • Vocab-specific variables for storing paths to external vocabulary term lookup files changed to a dictionary, for easier parametrization in factory routes

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

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-minor-breaking Feature or enhancement that breaks compatibility, will increment minor version (0.+1.0) label Oct 17, 2024
@coveralls
Copy link
Collaborator

coveralls commented Oct 17, 2024

Pull Request Test Coverage Report for Build 11388736781

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

  • 70 of 70 (100.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 95.603%

Totals Coverage Status
Change from base Build 11358250462: -0.04%
Covered Lines: 761
Relevant Lines: 796

💛 - Coveralls

Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks @alyssadai, very cool PR.

Couple of clarification comments, but otherwise 🧑‍🍳

app/api/routers/route_factory.py Outdated Show resolved Hide resolved
app/api/routers/route_factory.py Outdated Show resolved Hide resolved
@alyssadai alyssadai merged commit f16b0e4 into main Oct 17, 2024
7 checks passed
@alyssadai alyssadai deleted the refactor-attributes-router branch October 17, 2024 16:06
Copy link

🚀 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-minor-breaking Feature or enhancement that breaks compatibility, will increment minor version (0.+1.0) released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor generic /attributes router into attribute-specific routers
3 participants