Skip to content

Commit

Permalink
Merge pull request #498 from mingminsun/main
Browse files Browse the repository at this point in the history
add reconnect mysql if the connection is closed
  • Loading branch information
zainhoda authored Jun 17, 2024
2 parents 56b782b + 4ce62a6 commit e46b2f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/vanna/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ def connect_to_mysql(
def run_sql_mysql(sql: str) -> Union[pd.DataFrame, None]:
if conn:
try:
conn.ping(reconnect=True)
cs = conn.cursor()
cs.execute(sql)
results = cs.fetchall()
Expand Down

0 comments on commit e46b2f1

Please sign in to comment.