Skip to content

Commit 9e63a80

Browse files
committed
fixed error handler syntax in SQLDatabase.to_sql
1 parent 030b9fc commit 9e63a80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/io/sql.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1400,9 +1400,9 @@ def to_sql(
14001400
msg = '(1054, "Unknown column ' + "'inf' in 'field list'" + '")'
14011401
errText = str(err.orig)
14021402
if re.search(msg, errText):
1403-
raise ValueError("inf can not be used with MySQL")
1403+
raise ValueError("inf can not be used with MySQL") from err
14041404
else:
1405-
raise ValueError(err)
1405+
raise err
14061406

14071407
if not name.isdigit() and not name.islower():
14081408
# check for potentially case sensitivity issues (GH7815)

0 commit comments

Comments
 (0)