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

Bug in refresh_individual_sex_affected #686

Closed
holtgrewe opened this issue Sep 20, 2022 · 2 comments · Fixed by #687
Closed

Bug in refresh_individual_sex_affected #686

holtgrewe opened this issue Sep 20, 2022 · 2 comments · Fixed by #687
Labels
bug Something isn't working

Comments

@holtgrewe
Copy link
Collaborator

Describe the bug
The command introduced in the resolution of #158 can crash.

To Reproduce

# python /usr/src/app/manage.py refresh_individuals
Refreshing all clinvar_xml individuals
Traceback (most recent call last):
  File "/usr/src/app/manage.py", line 29, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/src/app/clinvar_export/management/commands/refresh_individuals.py", line 15, in handle
    refresh_individual_sex_affected()
  File "/usr/src/app/clinvar_export/models.py", line 405, in refresh_individual_sex_affected
    related_ped_entry = ped_entries[individual.name]
KeyError: '<REDACTED>'

Expected behavior
In this case, only a warning should be printed.

Additional context
N/A

@holtgrewe holtgrewe added the bug Something isn't working label Sep 20, 2022
@holtgrewe
Copy link
Collaborator Author

Root Cause Analysis
The assumption that the individual must be in the pedigree is wrong.

@holtgrewe
Copy link
Collaborator Author

Resolution Proposal
Check the existence of the individual in the Python dict. Print warning if it does not exist any more.

Affected Components
VarFish server

Affected Modules/Files
clinvar_export/models.py

Required Architectural Changes
None

Required Database Changes
None

Backport Possible?
Yes

Resolution Sketch
See above.

holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
@holtgrewe holtgrewe linked a pull request Sep 20, 2022 that will close this issue
holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
holtgrewe added a commit that referenced this issue Sep 20, 2022
Related-Issue: #686
Projected-Results-Impact: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant