bihealth / sodar-server

SODAR: System for Omics Data Access and Retrieval
https://github.com/bihealth/sodar-server
MIT License
14 stars 3 forks source link

Handle missing family column in germline study cache update #1921

Closed mikkonie closed 8 months ago

mikkonie commented 8 months ago

If the family column is not present in a germline study, attempting to update the cache results in a crash with list indices must be integers or slices, not NoneType.

I'm not 100% sure if we require for the column to be there or not. Technically, I would be able to replace the family ID automatically with the source ID is not present. I'd appreciate some feedback from experts of germline studies and our ISA-Tab template experts on what is the best way to proceed.

mikkonie commented 8 months ago

As a personal note, the crash happens in the germline study plugin _update_study_cache(), specifically here:

fam_idx = get_index_by_header(assay_table, 'family')
# ..
row_fam = row[fam_idx]['value']  # fam_idx ends up None if column is absent, hilarity ensues
mikkonie commented 8 months ago

It has been confirmed to me that the column is expected to be mandatory. I should still make handling it more graceful in the plugin: if index is not found, log missing column in timeline event.

mikkonie commented 8 months ago

I looked into this more closely and elsewhere we do also support not having a family column. This seems like a straighforward bug. Good thing is it's also straightforward to fix, so I'll get that in for v0.14.2.

mikkonie commented 8 months ago

Fixed.