Spaces:
Sleeping
Sleeping
Carlos Isael Ramírez González
commited on
Commit
·
e3aed4c
1
Parent(s):
b1e4b10
Cambio de connection
Browse files- mojica_agent.py +4 -1
mojica_agent.py
CHANGED
|
@@ -462,7 +462,10 @@ class MojicaAgent:
|
|
| 462 |
|
| 463 |
def _execute_sql(self, sql: str) -> Any:
|
| 464 |
try:
|
| 465 |
-
|
|
|
|
|
|
|
|
|
|
| 466 |
except Exception as e:
|
| 467 |
return f"Error: {str(e)}"
|
| 468 |
|
|
|
|
| 462 |
|
| 463 |
def _execute_sql(self, sql: str) -> Any:
|
| 464 |
try:
|
| 465 |
+
connection = sqlite3.connect(self.config.DB_PATH)
|
| 466 |
+
result = pd.read_sql_query(sql, connection)
|
| 467 |
+
connection.close()
|
| 468 |
+
return result
|
| 469 |
except Exception as e:
|
| 470 |
return f"Error: {str(e)}"
|
| 471 |
|