From 3fd39b21ff3d4d58709f9f11865098d037ca1399 Mon Sep 17 00:00:00 2001 From: "S. Paquette" Date: Thu, 12 Dec 2024 13:46:32 -0800 Subject: [PATCH] -> Proper condensation of values --- cohorts/metadata_counting.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cohorts/metadata_counting.py b/cohorts/metadata_counting.py index 6afaa1e7..b7d2976f 100644 --- a/cohorts/metadata_counting.py +++ b/cohorts/metadata_counting.py @@ -956,12 +956,10 @@ def get_full_case_metadata(ids, source_type, source): if data_type != id_type: for col_name, vals in data.items(): data[col_name] = list(set(vals)) - if None in data[col_name]: + if None in data[col_name] and len(data[col_name]) > 1: data[col_name].remove(None) if len(data[col_name]) == 1: - data[col_name] = vals[0] - elif not len(data[col_name]): - data[col_name] = "N/A" + data[col_name] = vals[0] if vals[0] is not None else "N/A" not_found = [x for x in ids if x not in cases]