Escape table name in queries
parent
98061e95c3
commit
6215406e34
2
tsplot
2
tsplot
|
@ -48,7 +48,7 @@ def get_data(topic, timerange, ts):
|
||||||
table = topic
|
table = topic
|
||||||
|
|
||||||
earliest = datetime.datetime.now() - timerange
|
earliest = datetime.datetime.now() - timerange
|
||||||
query = f"SELECT * FROM {table} WHERE timestamp > '{earliest}'"
|
query = f"SELECT * FROM \"{table}\" WHERE timestamp > '{earliest}'"
|
||||||
|
|
||||||
df = pd.read_sql(query, conn, parse_dates=[
|
df = pd.read_sql(query, conn, parse_dates=[
|
||||||
'timestamp'], index_col='timestamp')
|
'timestamp'], index_col='timestamp')
|
||||||
|
|
Loading…
Reference in New Issue