From 23ea4dd74da17bd3b7308f69e27ed67043fb2824 Mon Sep 17 00:00:00 2001 From: "13621160019@163.com" <13621160019@163.com> Date: Sun, 27 Mar 2022 15:18:44 +0800 Subject: [PATCH] removed dictionary parameter from cursor in myems-normalization service --- myems-normalization/virtualpoint.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/myems-normalization/virtualpoint.py b/myems-normalization/virtualpoint.py index 49a7297e..2c17fd68 100644 --- a/myems-normalization/virtualpoint.py +++ b/myems-normalization/virtualpoint.py @@ -22,7 +22,7 @@ def calculate(logger): cursor_system_db = None try: cnx_system_db = mysql.connector.connect(**config.myems_system_db) - cursor_system_db = cnx_system_db.cursor(dictionary=True) + cursor_system_db = cnx_system_db.cursor() except Exception as e: logger.error("Error in step 0 of virtual point calculate " + str(e)) if cursor_system_db: @@ -48,12 +48,12 @@ def calculate(logger): continue for row in rows_virtual_points: - meta_result = {"id": row['id'], - "name": row['name'], - "data_source_id": row['data_source_id'], - "high_limit": row['high_limit'], - "low_limit": row['low_limit'], - "address": row['address']} + meta_result = {"id": row[0], + "name": row[1], + "data_source_id": row[2], + "high_limit": row[3], + "low_limit": row[4], + "address": row[5]} virtual_point_list.append(meta_result) except Exception as e: