aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/base/data_set/utils.py3
1 files changed, 3 insertions, 0 deletions
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")