From e951afae0cd23bc292d321922e24ed8dee4cfa29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Jos=C3=A9=20Camacho?= Date: Mon, 2 Oct 2023 12:47:29 -0600 Subject: [PATCH] DH-4732 Datetime data types should be parsed as a string in query_results (#192) --- dataherald/sql_generator/create_sql_query_status.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dataherald/sql_generator/create_sql_query_status.py b/dataherald/sql_generator/create_sql_query_status.py index bc818354..88518034 100644 --- a/dataherald/sql_generator/create_sql_query_status.py +++ b/dataherald/sql_generator/create_sql_query_status.py @@ -1,4 +1,4 @@ -from datetime import date +from datetime import date, datetime from decimal import Decimal from sqlalchemy import text @@ -30,9 +30,10 @@ def create_sql_query_status( for row in result: modified_row = {} for key, value in zip(row.keys(), row, strict=True): - if ( - type(value) is date - ): # Check if the value is an instance of datetime.date + if type(value) in [ + date, + datetime, + ]: # Check if the value is an instance of datetime.date modified_row[key] = str(value) elif ( type(value) is Decimal