From cdfb7973f6461167319efcc2dd93a66265f7d694 Mon Sep 17 00:00:00 2001
From: Pierre-Gilles LEVALLOIS <plevallois@grandlyon.com>
Date: Tue, 16 May 2023 08:51:38 +0000
Subject: [PATCH] debug getProgress

---
 Dockerfiles/python/scripts/utils.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Dockerfiles/python/scripts/utils.py b/Dockerfiles/python/scripts/utils.py
index 81369fb..249b7e9 100644
--- a/Dockerfiles/python/scripts/utils.py
+++ b/Dockerfiles/python/scripts/utils.py
@@ -855,7 +855,10 @@ def getProgress(DBcursor, DBSchema, codeInsee, id_factor=None):
     qry = 'SELECT count(1) FROM '+ DBSchema + '.'  + stage + '_progress WHERE insee = ' + codeInsee + qryFilter
     debugLog(style.YELLOW, qry, logging.INFO)
     DBcursor.execute(qry)
-    dataValues = DBcursor.fetchall()[0][0]  # Accéder à l'élément à l'indice 0 de la première liste
+    results = DBcursor.fetchall()
+    debugLog(style.YELLOW, results, logging.INFO)
+    dataValues = results[0]['count'] 
+    # dataValues = DBcursor.fetchall()[0][0]  # Accéder à l'élément à l'indice 0 de la première liste
     return dataValues
 
 def resetProgress(DB_params, DB_schema):
-- 
GitLab