From 3d3b153f42da30caab130a84b3eb7c3b8c3dd05b Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 8 Jun 2021 19:12:28 +0000 Subject: Fix issue where some groups apparently don't have samplelists --- wqflask/wqflask/export_traits.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py index a22d6acc..5459dc31 100644 --- a/wqflask/wqflask/export_traits.py +++ b/wqflask/wqflask/export_traits.py @@ -65,14 +65,18 @@ def export_search_results_csv(targs): traits_by_group = sort_traits_by_group(trait_list) file_list = [] - for group in list(traits_by_group.keys()): + for group in traits_by_group: group_traits = traits_by_group[group] + samplelist = group_traits[0].dataset.group.samplelist + if not samplelist: + continue + buff = io.StringIO() writer = csv.writer(buff) csv_rows = [] sample_headers = [] - for sample in group_traits[0].dataset.group.samplelist: + for sample in samplelist: sample_headers.append(sample) sample_headers.append(sample + "_SE") -- cgit v1.2.3