Skip to content

Commit

Permalink
REGR: fix read_sql delegation for queries on MySQL/pymysql (pandas-de…
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored and Pingviinituutti committed Feb 28, 2019
1 parent 474d29d commit 0628efa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.24.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Fixed Regressions

- Bug in :meth:`DataFrame.itertuples` with ``records`` orient raising an ``AttributeError`` when the ``DataFrame`` contained more than 255 columns (:issue:`24939`)
- Bug in :meth:`DataFrame.itertuples` orient converting integer column names to strings prepended with an underscore (:issue:`24940`)
- Fixed regression in :func:`read_sql` when passing certain queries with MySQL/pymysql (:issue:`24988`).
- Fixed regression in :class:`Index.intersection` incorrectly sorting the values by default (:issue:`24959`).
- Fixed regression in :func:`merge` when merging an empty ``DataFrame`` with multiple timezone-aware columns on one of the timezone-aware columns (:issue:`25014`).

Expand Down
3 changes: 2 additions & 1 deletion pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ def read_sql(sql, con, index_col=None, coerce_float=True, params=None,

try:
_is_table_name = pandas_sql.has_table(sql)
except (ImportError, AttributeError):
except Exception:
# using generic exception to catch errors from sql drivers (GH24988)
_is_table_name = False

if _is_table_name:
Expand Down

0 comments on commit 0628efa

Please sign in to comment.