From 183188f2c576ab6452c37387852cfe9ddcf1ff59 Mon Sep 17 00:00:00 2001 From: thenav56 Date: Fri, 30 Jun 2023 17:01:59 +0545 Subject: [PATCH] Check for `null`::TEXT for fallback custom options value --- .../mapswipe_workers/generate_stats/overall_stats.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mapswipe_workers/mapswipe_workers/generate_stats/overall_stats.py b/mapswipe_workers/mapswipe_workers/generate_stats/overall_stats.py index 8e2791ff9..0e4212e65 100644 --- a/mapswipe_workers/mapswipe_workers/generate_stats/overall_stats.py +++ b/mapswipe_workers/mapswipe_workers/generate_stats/overall_stats.py @@ -68,7 +68,10 @@ def get_project_static_info(filename: str) -> pd.DataFrame: ,created -- Custom options values ,CASE - WHEN project_type_specifics->'customOptions' IS NOT NULL + WHEN ( + project_type_specifics->'customOptions' IS NOT NULL AND + (project_type_specifics->'customOptions')::TEXT != 'null'::TEXT + ) THEN -- thus if we have answer labels use them (project_type_specifics->'customOptions')::TEXT ELSE -- otherwise use below label range as the mapswipe app default