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] Handle partial nodes success #55

Merged
merged 21 commits into from
Jan 14, 2024
Merged

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Jan 11, 2024

Changes proposed in this pull request:

  • New response model for federated response that includes node-specific errors and successful query results, as well as an overall nodes response status
  • When >=1 nodes fail, use a custom 207 HTTP success code for overall response from API
  • Print any encountered node errors to the console, as well as summary statement about # nodes successfully queried
  • When querying individual nodes, gracefully handle any network/node connection errors related to the request (i.e., if node API is unreachable)
  • Switch to async process for sending out individual node requests

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 Jan 11, 2024

Pull Request Test Coverage Report for Build 7521932835

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 99.314%

Totals Coverage Status
Change from base Build 7266039620: 0.6%
Covered Lines: 579
Relevant Lines: 583

💛 - Coveralls

@surchs surchs self-requested a review January 11, 2024 16:40
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.

Thank you very much @alyssadai for this great PR 🎉 ! I left some comments but otherwise 🧑‍🍳

app/api/crud.py Show resolved Hide resolved
app/api/crud.py Show resolved Hide resolved
app/api/models.py Show resolved Hide resolved
app/api/crud.py Outdated Show resolved Hide resolved
app/api/crud.py Show resolved Hide resolved
app/api/crud.py Show resolved Hide resolved
tests/test_query.py Outdated Show resolved Hide resolved
tests/test_query.py Show resolved Hide resolved
alyssadai and others added 2 commits January 14, 2024 16:34
Co-authored-by: Sebastian Urchs <surchs@users.noreply.github.com>
@alyssadai alyssadai merged commit 3e76fd0 into main Jan 14, 2024
5 checks passed
@alyssadai alyssadai deleted the handle-partial-nodes-success branch January 14, 2024 22:59
@surchs
Copy link
Contributor

surchs commented Apr 11, 2024

🚀 PR was released in v0.1.0 🚀

@surchs surchs added the released This issue/pull request has been released. label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle cases where requests to some nodes fail
3 participants