From 6d7f74af75251dafab794d18b18bd3790c0a2f61 Mon Sep 17 00:00:00 2001 From: Simon Belak <simon.belak@gmail.com> Date: Mon, 13 Nov 2017 18:44:57 +0100 Subject: [PATCH] Make zero and nil insights work with no data --- src/metabase/feature_extraction/insights.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metabase/feature_extraction/insights.clj b/src/metabase/feature_extraction/insights.clj index b2c2d35bfdb..c3d3b892810 100644 --- a/src/metabase/feature_extraction/insights.clj +++ b/src/metabase/feature_extraction/insights.clj @@ -32,7 +32,7 @@ (definsight nils "Are there any nils in the data?" [nil% field count] - (when (pos? nil%) + (when (some-> nil% pos?) {:quality (if (< nil% (/ (Math/log (inc count)))) :some :many) @@ -41,7 +41,7 @@ (definsight zeros "Are there any 0s in the data?" [zero% field count] - (when (pos? zero%) + (when (some-> zero% pos?) {:quality (if (< zero% (/ (Math/log (inc count)))) :some :many) -- GitLab