-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: Fix type hint for params passed to read_sql_query #52357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TYP: Fix type hint for params passed to read_sql_query #52357
Conversation
9a34687
to
d52575d
Compare
@@ -357,7 +358,7 @@ def read_sql_query( | |||
con, | |||
index_col: str | list[str] | None = ..., | |||
coerce_float=..., | |||
params: list[str] | dict[str, str] | None = ..., | |||
params: list[Any] | Mapping[str, Any] | None = ..., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the Any been made more specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is one of the rare cases where Any
is correct. See the type hint in SQLAlchemy which we are calling into here:
https://github.com/sqlalchemy/sqlalchemy/blob/e79ab08165e01dc7af50fcffadb31468ace51b6c/lib/sqlalchemy/engine/base.py#L1370-L1376
https://github.com/sqlalchemy/sqlalchemy/blob/e79ab08165e01dc7af50fcffadb31468ace51b6c/lib/sqlalchemy/engine/interfaces.py#L224-L229
d52575d
to
20ed8ad
Compare
CI failed due to a GitHub issue. Can someone rerun the checks? |
Thanks @Tolker-KU |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.