Spaces:
Runtime error
Runtime error
Commit ·
ad66df5
1
Parent(s): e5720b5
disconnect and connect before running query
Browse files
app.py
CHANGED
|
@@ -91,6 +91,7 @@ def testSQL(sql):
|
|
| 91 |
if not isDataQuery(sql):
|
| 92 |
return "Sorry not allowed to run. As the query modifies the data."
|
| 93 |
try:
|
|
|
|
| 94 |
dbEngine.connect()
|
| 95 |
conn = dbEngine.getConnection()
|
| 96 |
df = pd.read_sql_query(sql, con=conn)
|
|
|
|
| 91 |
if not isDataQuery(sql):
|
| 92 |
return "Sorry not allowed to run. As the query modifies the data."
|
| 93 |
try:
|
| 94 |
+
dbEngine.disconnect()
|
| 95 |
dbEngine.connect()
|
| 96 |
conn = dbEngine.getConnection()
|
| 97 |
df = pd.read_sql_query(sql, con=conn)
|