From b414da7ff3c84564931388e81c729f0dfd06d0c3 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 17 Mar 2023 16:25:51 +0000 Subject: Fix correlation bug caused by a NULL UPDATE_TIME in the DB --- wqflask/base/data_set/utils.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'wqflask/base/data_set') diff --git a/wqflask/base/data_set/utils.py b/wqflask/base/data_set/utils.py index 0077c292..703fee04 100644 --- a/wqflask/base/data_set/utils.py +++ b/wqflask/base/data_set/utils.py @@ -1,5 +1,6 @@ "data_set package utilities" +import datetime import os import json import hashlib @@ -33,6 +34,8 @@ def query_table_timestamp(dataset_type: str): f"WHERE TABLE_SCHEMA = '{fetch_db_name[3]}' " f"AND TABLE_NAME = '{dataset_type}Data'") date_time_obj = cursor.fetchone()[0] + if not date_time_obj: + date_time_obj = datetime.datetime.now() return date_time_obj.strftime("%Y-%m-%d %H:%M:%S") -- cgit v1.2.3