From 0ef1a7038a3ddb070d128a0e3c1f1fa3a021fad1 Mon Sep 17 00:00:00 2001 From: Tanmoy Sarkar <57363826+tanmoysrt@users.noreply.github.com> Date: Mon, 21 Oct 2024 06:10:52 +0000 Subject: [PATCH] chore: ruff format --- agent/database.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/agent/database.py b/agent/database.py index 8087ea70..fd7fd79e 100644 --- a/agent/database.py +++ b/agent/database.py @@ -35,7 +35,7 @@ def execute_query(self, query: str, commit: bool = False, as_dict: bool = False) ) # Private helper methods - def _sql(self, query: str, params=(), commit: bool = False, as_dict: bool = False) -> dict | None: # noqa: C901 + def _sql(self, query: str, params=(), commit: bool = False, as_dict: bool = False) -> dict | None: # noqa: C901 """ Run sql query in database It supports multi-line SQL queries. Each SQL Query should be terminated with `;\n` @@ -106,11 +106,7 @@ def _sql(self, query: str, params=(), commit: bool = False, as_dict: bool = Fals output = list(map(lambda x: dict(zip(columns, x)), rows)) else: output = {"columns": columns, "data": rows} - results.append({ - "query": q, - "output": output, - "row_count": row_count - }) + results.append({"query": q, "output": output, "row_count": row_count}) except: # if query execution fails, rollback the transaction and raise the error self.db.rollback()