From 5318ee31fabdabdf405d88290feb86efb66ecfb9 Mon Sep 17 00:00:00 2001
From: Gjorgji <g.noveski@yahoo.com>
Date: Wed, 17 May 2023 15:20:14 +0200
Subject: [PATCH] Fixing recc.engine bug - empty dictionaries in kpis

---
 app/api/dexi.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/api/dexi.py b/app/api/dexi.py
index 276c26d..38f2c9f 100644
--- a/app/api/dexi.py
+++ b/app/api/dexi.py
@@ -360,7 +360,7 @@ def plus_one_kpi_change_generator(json_file: Dict, step_size, analysis_limit):
         was_it_increased_flag = False
         if k == 'simulation_id':
             continue
-        if isinstance(v, dict):
+        if isinstance(v, dict) and len(v) != 0:
             json_file[k] = plus_one_kpi_change_generator(v, step_size, analysis_limit)
             for i in json_file[k]:
                 json_file[k] = i[0]
-- 
GitLab