populationgenomics / metamist

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

Fix individual metadata for seqr layer headers #774

Closed EddieLF closed 4 months ago

EddieLF commented 4 months ago

OK really silly bug that I missed when I changed the code to use walrus at the last minute before submitting my previous PR.

Basically we need an extra set of parentheses to define the header variable in the loop, or else the headers list is just full of True.

list1 = ['a','b','c']
list2 = ['a','c','d']

# header defined as "item in list2"
# if condition evaluates `header=True`
for item in list1:
  if header := item in list2:
    print(header)
>True
>True

# header defined as "item"
# if condition evaluates `header in list2`
for item in list1:
  if (header := item) in list2:
    print(header)
>a
>c
codecov-commenter commented 4 months ago

Codecov Report

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

Project coverage is 77.12%. Comparing base (46a5cf5) to head (b7f4e7f).

Files Patch % Lines
db/python/layers/participant.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #774 +/- ## ========================================== - Coverage 77.13% 77.12% -0.01% ========================================== Files 157 157 Lines 12956 12957 +1 ========================================== Hits 9993 9993 - Misses 2963 2964 +1 ```

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

EddieLF commented 4 months ago

@illusional sure, I've split the header definition in the loop onto an extra line for clarity.