Skip to content

Update cbioportalImporter.py#133

Open
DheerajRawandhe wants to merge 1 commit into
cBioPortal:mainfrom
DheerajRawandhe:main
Open

Update cbioportalImporter.py#133
DheerajRawandhe wants to merge 1 commit into
cBioPortal:mainfrom
DheerajRawandhe:main

Conversation

@DheerajRawandhe
Copy link
Copy Markdown

What this PR does

Fixes an issue where deleting samples could leave patients with no samples.

Problem

The remove-samples command removed only samples, but not patients.
This created "sample-less" patients, which can break API or UI.

Fix

After deleting samples:

  • Check patients linked to those samples
  • If a patient has 0 samples left → delete that patient too

Result

  • No invalid patients in DB
  • Data stays clean and consistent

Test

  • Deleted last sample of a patient → patient also deleted
  • Deleted some samples → patient still exists

@sheridancbio
Copy link
Copy Markdown
Contributor

I believe we want to support studies which contain patients which have no samples. Others should comment --- does this break the API or frontend? If we want to support instances of patients with no samples perhaps the API implementations and frontend logic must be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants