populationgenomics / metamist

Sample level metadata system
MIT License
1 stars 1 forks source link

Custom Cohorts Fixes #781

Closed vivbak closed 4 months ago

vivbak commented 4 months ago

Fixes https://github.com/populationgenomics/metamist/issues/780

The issues were: 1- Project was not being passed to the filter, so the query would return everything (if you enter via project) 2- The template project was not being stored on the template model 3- Cohort criteria was being returned as the model, but needs to be in dict form to display on UI, so required a to_external method.

codecov-commenter commented 4 months ago

Codecov Report

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

Project coverage is 77.07%. Comparing base (d21e399) to head (c8465f2).

Files Patch % Lines
api/graphql/schema.py 9.09% 10 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #781 +/- ## ========================================== - Coverage 77.08% 77.07% -0.02% ========================================== Files 157 157 Lines 12967 12990 +23 ========================================== + Hits 9996 10012 +16 - Misses 2971 2978 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jmarshall commented 4 months ago

Codecov is right — the new to_external() method deserves a test. There might be somewhere natural in the existing tests to exercise it, or might want a new test case. I'm happy to do that if you want?

vivbak commented 4 months ago

If you were able to test it that would be great @jmarshall!

jmarshall commented 4 months ago

Tests added — you'll need to change the asserts (to the commented out ones) if you manage to change the return type to CohortCriteria.