Skip to content

Commit

Permalink
Merge pull request #420 from zyclove/main
Browse files Browse the repository at this point in the history
fix for a known problem with presto db where an extra ; will cause a error
  • Loading branch information
zainhoda authored May 7, 2024
2 parents a41f8e2 + 2437cf3 commit e2572af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vanna/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,10 @@ def connect_to_presto(
def run_sql_presto(sql: str) -> Union[pd.DataFrame, None]:
if conn:
try:
sql = sql.rstrip()
# fix for a known problem with presto db where an extra ; will cause an error.
if sql.endswith(';'):
sql = sql[:-1]
cs = conn.cursor()
cs.execute(sql)
results = cs.fetchall()
Expand Down

0 comments on commit e2572af

Please sign in to comment.