Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
illusional authored Apr 23, 2024
1 parent a7851ad commit e5c4b23
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions api/graphql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ async def families(
id: GraphQLFilter[int] | None = None,
external_id: GraphQLFilter[str] | None = None,
) -> list['GraphQLFamily']:
# don't need a data loader here as we're presuming we're not often running
# the "families" method for many projects at once. If so, we might need to fix that
connection = info.context['connection']
families = await FamilyLayer(connection).query(
FamilyFilter(
Expand Down
6 changes: 3 additions & 3 deletions db/python/layers/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ async def get_pedigree(
mapped_rows.append(
{
'family_id': fmap.get(r.family_id, str(r.family_id)),
'individual_id': pmap.get(r.individual_id, empty_participant_value),
'paternal_id': pmap.get(r.paternal_id, empty_participant_value),
'maternal_id': pmap.get(r.maternal_id, empty_participant_value),
'individual_id': pmap.get(r.individual_id, r.individual_id) or empty_participant_value,
'paternal_id': pmap.get(r.paternal_id, r.paternal_id) or empty_participant_value),
'maternal_id': pmap.get(r.maternal_id, r.maternal_id) or empty_participant_value),
'sex': r.sex,
'affected': r.affected,
'notes': r.notes,
Expand Down
2 changes: 1 addition & 1 deletion db/python/tables/family_participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async def delete_family_participant_row(self, family_id: int, participant_id: in

_update_before_delete = """
UPDATE family_participant
set audit_log_id = :audit_log_id
SET audit_log_id = :audit_log_id
WHERE family_id = :family_id AND participant_id = :participant_id
"""

Expand Down

0 comments on commit e5c4b23

Please sign in to comment.