You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context:
Pandas read_sql is now raising a warning suggesting moving from a DB-API connection to a SQLAlchemy connection. Hence we are trying to make the switch.
Issue:
When using a SQLAlchemy connection, if the query has any format characters in it, then an error is raised. No issue with a DB-API connection.
Example query:
-- Format character in a comment %SELECT1
Likely Cause
When deciding whether to format the operation, PyHive checks if the given parameters is None.
However, SQLAlchemy (1.4.31) always at least passes an empty dictionary (since it builds these params off of kwargs which default to an empty dict) so it is never None.
Context:
Pandas
read_sql
is now raising a warning suggesting moving from a DB-API connection to a SQLAlchemy connection. Hence we are trying to make the switch.Issue:
When using a SQLAlchemy connection, if the query has any format characters in it, then an error is raised. No issue with a DB-API connection.
Example query:
Likely Cause
When deciding whether to format the operation, PyHive checks if the given
parameters
is None.PyHive/pyhive/presto.py
Line 256 in d199a1b
However, SQLAlchemy (1.4.31) always at least passes an empty dictionary (since it builds these params off of kwargs which default to an empty dict) so it is never None.
https://github.com/sqlalchemy/sqlalchemy/blob/2eac6545ad08db83954dd3afebf4894a0acb0cea/lib/sqlalchemy/engine/base.py#L1196
Likely Fix
Just need to also check if params is an empty dict:
The text was updated successfully, but these errors were encountered: