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

Refactor families + add family participants to graphql #740

Merged
merged 15 commits into from
May 1, 2024

Conversation

illusional
Copy link
Contributor

I got carried away, but broadly:

  • Refactor the family layer + table to support the newer flavour of querying (+ cleanup a few methods)
  • Add family participants to the graphql schema
  • Remove the type: ignore for the graphql schema, so there's better type checking there.

Will self-review, then assign out soon.

api/graphql/schema.py Show resolved Hide resolved
api/graphql/schema.py Show resolved Hide resolved
db/python/layers/family.py Outdated Show resolved Hide resolved
db/python/tables/family_participant.py Outdated Show resolved Hide resolved
illusional and others added 4 commits April 23, 2024 22:31
…articipants-to-graphql' of github.com:populationgenomics/metamist into add-family-participants-to-graphql
@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 77.36721% with 98 lines in your changes are missing coverage. Please review.

Project coverage is 77.15%. Comparing base (8ee989f) to head (83eb562).
Report is 2 commits behind head on dev.

Files Patch % Lines
models/models/family.py 64.44% 48 Missing ⚠️
db/python/layers/family.py 66.03% 18 Missing ⚠️
api/graphql/schema.py 83.33% 10 Missing ⚠️
db/python/tables/family_participant.py 77.14% 8 Missing ⚠️
db/python/tables/family.py 74.07% 7 Missing ⚠️
db/python/utils.py 82.60% 4 Missing ⚠️
db/python/layers/participant.py 87.50% 2 Missing ⚠️
api/routes/family.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #740      +/-   ##
==========================================
+ Coverage   76.47%   77.15%   +0.68%     
==========================================
  Files         148      157       +9     
  Lines       11919    12945    +1026     
==========================================
+ Hits         9115     9988     +873     
- Misses       2804     2957     +153     

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

@illusional illusional requested a review from EddieLF April 23, 2024 12:42
@illusional illusional marked this pull request as ready for review April 23, 2024 12:42
Copy link
Contributor

@EddieLF EddieLF left a comment

Choose a reason for hiding this comment

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

It looks like there's a lot of cleaning up of the db typehints and changes to the graphql filters & loaders - how much do these reviewed? I can see the tests cover a fair chunk of it, but obviously Codecov has noted there are aspects missing from tests.

Otherwise, this is my understanding:
The entries in the family_participant table will now be query-able through GraphQL, either as a child of a query for participant or family. They won't be query-able at the root level, because a family_participant function hasn't been added to api/graphql/schema.py under the Query class.

When queried, a FamilyParticipant node will have the affected status as an integer field under affected (alongside notes, participant_id, family_id).

The family layers/tables updates also let you query families and filter the results by family IDs and/or family external IDs.

Is my understanding correct? And what do you think about the test coverage?

All in all, this looks pretty good! 👍

db/python/layers/family.py Outdated Show resolved Hide resolved
db/python/layers/family.py Outdated Show resolved Hide resolved
@illusional
Copy link
Contributor Author

Thanks @EddieLF! Yeah, a bit of extra refactoring here to bring it in line with other classes.
Yep, all your points are exactly correct! I've made a few changes per your suggestions, and to improve code coverage on some of the things I've changed (resulting in more changes).

I'm going to merge this one after #615, because I'll need to update a few things that I've changed here - so if you want to re-review, feel free to do it after that. Let me know if you're not comfy with approving this (though I think you're in a great position too :) ).

Thanks for the review!

Copy link
Contributor

@EddieLF EddieLF left a comment

Choose a reason for hiding this comment

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

Looks good to me, nice that you improved the test coverage and also updated the participant layer typing typehints to align with the other typehint changes ➕ 👍

@illusional illusional merged commit 5451b07 into dev May 1, 2024
5 checks passed
@illusional illusional deleted the add-family-participants-to-graphql branch May 1, 2024 03:51
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.

3 participants