From a0ce616c7daae7b476f07b8c069a526f92dbf79a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 12 Sep 2022 07:28:24 +0300 Subject: Check there is target data before running correlations --- 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 8e8cd463..5b39c871 100644 --- a/wqflask/wqflask/correlation/rust_correlation.py +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -247,6 +247,9 @@ def __compute_sample_corr__( r = ",".join(lts) target_data.append(r) + if len(target_data) == 0: + return {} + return run_correlation( target_data, list(sample_data.values()), method, ",", corr_type, n_top) -- cgit v1.2.3