Skip to content

Commit c537b36

Browse files
Tolker-KUmroeschke
andauthored
TYP: Fix type hint for params passed to read_sql_query (#52357)
Fix type hint for params passed to read_sql_query Co-authored-by: Matthew Roeschke <[email protected]>
1 parent bff1261 commit c537b36

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/io/sql.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
Any,
2626
Iterator,
2727
Literal,
28+
Mapping,
2829
cast,
2930
overload,
3031
)
@@ -357,7 +358,7 @@ def read_sql_query(
357358
con,
358359
index_col: str | list[str] | None = ...,
359360
coerce_float=...,
360-
params: list[str] | dict[str, str] | None = ...,
361+
params: list[Any] | Mapping[str, Any] | None = ...,
361362
parse_dates: list[str] | dict[str, str] | None = ...,
362363
chunksize: None = ...,
363364
dtype: DtypeArg | None = ...,
@@ -372,7 +373,7 @@ def read_sql_query(
372373
con,
373374
index_col: str | list[str] | None = ...,
374375
coerce_float=...,
375-
params: list[str] | dict[str, str] | None = ...,
376+
params: list[Any] | Mapping[str, Any] | None = ...,
376377
parse_dates: list[str] | dict[str, str] | None = ...,
377378
chunksize: int = ...,
378379
dtype: DtypeArg | None = ...,
@@ -386,7 +387,7 @@ def read_sql_query(
386387
con,
387388
index_col: str | list[str] | None = None,
388389
coerce_float: bool = True,
389-
params: list[str] | dict[str, str] | None = None,
390+
params: list[Any] | Mapping[str, Any] | None = None,
390391
parse_dates: list[str] | dict[str, str] | None = None,
391392
chunksize: int | None = None,
392393
dtype: DtypeArg | None = None,
@@ -411,7 +412,7 @@ def read_sql_query(
411412
coerce_float : bool, default True
412413
Attempts to convert values of non-string, non-numeric objects (like
413414
decimal.Decimal) to floating point. Useful for SQL result sets.
414-
params : list, tuple or dict, optional, default: None
415+
params : list, tuple or mapping, optional, default: None
415416
List of parameters to pass to execute method. The syntax used
416417
to pass parameters is database driver dependent. Check your
417418
database driver documentation for which of the five syntax styles,

0 commit comments

Comments
 (0)