From 3d685ef96c6a4dfe6d7e77b71ea075d50fae9f13 Mon Sep 17 00:00:00 2001 From: Pradip Parkale Date: Mon, 14 Jun 2021 16:42:27 +0530 Subject: [PATCH] Updated variable name as per review comments. --- web/pgadmin/utils/driver/psycopg2/typecast.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/pgadmin/utils/driver/psycopg2/typecast.py b/web/pgadmin/utils/driver/psycopg2/typecast.py index 0250e9316..34b2779e3 100644 --- a/web/pgadmin/utils/driver/psycopg2/typecast.py +++ b/web/pgadmin/utils/driver/psycopg2/typecast.py @@ -201,17 +201,17 @@ def register_string_typecasters(connection): def numeric_typecasters(results, conn_obj): # This function is to convert pg types to numeic type caster - data = [] + numeric_cols = [] for obj_type in conn_obj.column_info: if obj_type['type_code'] in TO_STRING_NUMERIC_DATATYPES: - data.append(obj_type['name']) + numeric_cols.append(obj_type['name']) for result in results: for key, value in result.items(): if isinstance(result[key], - str) and key in data and not value.isdigit(): + str) and key in numeric_cols and not value.isdigit(): result[key] = float(result[key]) - elif isinstance(result[key], str) and key in data: + elif isinstance(result[key], str) and key in numeric_cols: result[key] = int(result[key]) return results