lf_dash.py : try except added around appending to db with different columns

1. the databases need to match with the column layout for kpi, the db may get
corrupted, either enter a new db or regenerate old one.

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-08-06 07:42:50 -06:00
parent 7fbd233b71
commit 399a53b895

View File

@@ -65,7 +65,11 @@ class csv_sqlite_dash():
self.df = self.df.append(df_kpi_tmp, ignore_index=True)
self.conn = sqlite3.connect(self.database)
self.df.to_sql(self.table,self.conn,if_exists='append')
try:
self.df.to_sql(self.table,self.conn,if_exists='append')
except:
print("attempt to append to database with different column layout, casused exception, input new name --database <new name>")
exit(1)
self.conn.close()
def generate_graph_png(self):