Skip to content

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

Merged
merged 2 commits into from
Apr 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
Any,
Iterator,
Literal,
Mapping,
cast,
overload,
)
Expand Down Expand Up @@ -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 = ...,
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse_dates: list[str] | dict[str, str] | None = ...,
chunksize: None = ...,
dtype: DtypeArg | None = ...,
Expand All @@ -372,7 +373,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 = ...,
parse_dates: list[str] | dict[str, str] | None = ...,
chunksize: int = ...,
dtype: DtypeArg | None = ...,
Expand All @@ -386,7 +387,7 @@ def read_sql_query(
con,
index_col: str | list[str] | None = None,
coerce_float: bool = True,
params: list[str] | dict[str, str] | None = None,
params: list[Any] | Mapping[str, Any] | None = None,
parse_dates: list[str] | dict[str, str] | None = None,
chunksize: int | None = None,
dtype: DtypeArg | None = None,
Expand All @@ -411,7 +412,7 @@ def read_sql_query(
coerce_float : bool, default True
Attempts to convert values of non-string, non-numeric objects (like
decimal.Decimal) to floating point. Useful for SQL result sets.
params : list, tuple or dict, optional, default: None
params : list, tuple or mapping, optional, default: None
List of parameters to pass to execute method. The syntax used
to pass parameters is database driver dependent. Check your
database driver documentation for which of the five syntax styles,
Expand Down