From 7e7d31e842e3abfcc87729bfee12c8db25c565f1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 9 Sep 2022 08:16:39 +0300 Subject: Filter out Samples without values --- wqflask/base/data_set.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'wqflask/base') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 4d708e59..6c6deea9 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -749,8 +749,12 @@ class DataSet: (self.group.species,) ) results = dict(cursor.fetchall()) - sample_ids = [results.get(item) - for item in self.samplelist if item is not None] + sample_ids = [ + sample_id for sample_id in + (results.get(item) for item in self.samplelist + if item is not None) + if sample_id is not None + ] # MySQL limits the number of tables that can be used in a join to 61, # so we break the sample ids into smaller chunks -- cgit v1.2.3