Skip to content

Commit

Permalink
Merge pull request #279 from Sage-Bionetworks/hotfix
Browse files Browse the repository at this point in the history
Make sure if there are no valid clinical files that nothing is appended
  • Loading branch information
thomasyu888 authored Apr 16, 2020
2 parents cfa3353 + 9d7ee57 commit d76e49c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions genie/input_to_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,13 @@ def center_input_to_database(

# merge clinical files into one row
clinical_ind = validFiles['fileType'] == "clinical"
clinical_files = validFiles[clinical_ind].to_dict(orient='list')
# The [] implies the values in the dict as a list
merged_clinical = pd.DataFrame([clinical_files])
merged_clinical['fileType'] = 'clinical'
merged_clinical['name'] = "data_clinical_supp_{}.txt".format(center)
validFiles = validFiles[~clinical_ind].append(merged_clinical)
if clinical_ind.any():
clinical_files = validFiles[clinical_ind].to_dict(orient='list')
# The [] implies the values in the dict as a list
merged_clinical = pd.DataFrame([clinical_files])
merged_clinical['fileType'] = 'clinical'
merged_clinical['name'] = f"data_clinical_supp_{center}.txt"
validFiles = validFiles[~clinical_ind].append(merged_clinical)

processTrackerSynId = process_functions.getDatabaseSynId(
syn, "processTracker",
Expand Down

0 comments on commit d76e49c

Please sign in to comment.