From df7ae4856b2191c449d96eac42ce23d3f830073d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 12 Sep 2022 07:11:33 +0300 Subject: Check for traits before computing --- wqflask/wqflask/correlation/rust_correlation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py index 214a47e7..debc4930 100644 --- a/wqflask/wqflask/correlation/rust_correlation.py +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -131,6 +131,9 @@ def compute_top_n_sample(start_vars, dataset, trait_list): (sample_data, sample_ids) = __fetch_sample_ids__( start_vars["sample_vals"], start_vars["corr_samples_group"]) + if len(trait_list) == 0: + return {} + with database_connector() as conn: with conn.cursor() as curr: # fetching strain data in bulk -- cgit v1.2.3