Skip to content

Commit

Permalink
fix: Execute and Parse test for DuckDB
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjibansg committed Jun 24, 2023
1 parent 2b68adf commit dfeb7f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/backend/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def check(self):
def execute(self, data):
try:
if self.check()["db_health"] != "up and running":
self.connection = self.connect()
self.connect()
for i in data:
self.connection.execute(query=i)
return {"message": "DuckDB Operation successful"}
Expand All @@ -66,7 +66,7 @@ def execute(self, data):
def parse(self, data):
try:
if self.check()["db_health"] != "up and running":
self.connection = self.connect()
self.connect()
result = self.connection.get_substrait_json(data["query"]).fetchone()[0]
return result
except Exception as e:
Expand Down

0 comments on commit dfeb7f6

Please sign in to comment.