kids-first/kf-api-dataservice

Deleting a SEGF relationship appears to delete the connected SE

fiendish opened this issue · 3 comments

That's unexpected. At least it doesn't also delete the GF, which is good.

@fiendish It doesn't actually delete the SE but it will appear like that (when you query /sequencing-experiments?study_id=blah) because once you delete the SE-GF, you've broken the join path between the SE and the study. If you were to add back in the SE-GF, I bet your SE will still be there

Oops.

I think this means there are dangling SEs now.

Ah you know what @fiendish, your original issue may be correct. When you delete SEGF records, it does not cascade delete the SE. However, after the delete operation it does check for dangling SE and it will delete those.

The code for that is here:

def delete_orphans(mapper, connection, state):

Is this the desired behavior or do we want those SEs to stick around even if we delete their links to the participant tree?