Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -144,7 +144,7 @@ def sql_engine(query: str) -> str:
|
|
144 |
rows = con.execute(text(query)).fetchall()
|
145 |
if not rows:
|
146 |
return "No results found."
|
147 |
-
if len(rows) 1 and len(rows[0]) 1:
|
148 |
return str(rows[0][0])
|
149 |
return "\n".join([", ".join(map(str, row)) for row in rows])
|
150 |
except Exception as e:
|
|
|
144 |
rows = con.execute(text(query)).fetchall()
|
145 |
if not rows:
|
146 |
return "No results found."
|
147 |
+
if len(rows) == 1 and len(rows[0]) == 1: # Fixed the comparison operators here
|
148 |
return str(rows[0][0])
|
149 |
return "\n".join([", ".join(map(str, row)) for row in rows])
|
150 |
except Exception as e:
|