Skip to content

Commit f0867de

Browse files
committed
Fixed type annotations for read_sql_* functions.
Added dict of dict type to parse_dates union to match valid arguments.
1 parent b0192c7 commit f0867de

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pandas/io/sql.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def read_sql_table( # pyright: ignore[reportOverlappingOverload]
241241
schema=...,
242242
index_col: str | list[str] | None = ...,
243243
coerce_float=...,
244-
parse_dates: list[str] | dict[str, str] | None = ...,
244+
parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ...,
245245
columns: list[str] | None = ...,
246246
chunksize: None = ...,
247247
dtype_backend: DtypeBackend | lib.NoDefault = ...,
@@ -255,7 +255,7 @@ def read_sql_table(
255255
schema=...,
256256
index_col: str | list[str] | None = ...,
257257
coerce_float=...,
258-
parse_dates: list[str] | dict[str, str] | None = ...,
258+
parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ...,
259259
columns: list[str] | None = ...,
260260
chunksize: int = ...,
261261
dtype_backend: DtypeBackend | lib.NoDefault = ...,
@@ -268,7 +268,7 @@ def read_sql_table(
268268
schema: str | None = None,
269269
index_col: str | list[str] | None = None,
270270
coerce_float: bool = True,
271-
parse_dates: list[str] | dict[str, str] | None = None,
271+
parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = None,
272272
columns: list[str] | None = None,
273273
chunksize: int | None = None,
274274
dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default,
@@ -372,21 +372,20 @@ def read_sql_query( # pyright: ignore[reportOverlappingOverload]
372372
index_col: str | list[str] | None = ...,
373373
coerce_float=...,
374374
params: list[Any] | Mapping[str, Any] | None = ...,
375-
parse_dates: list[str] | dict[str, str] | None = ...,
375+
parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ...,
376376
chunksize: None = ...,
377377
dtype: DtypeArg | None = ...,
378378
dtype_backend: DtypeBackend | lib.NoDefault = ...,
379379
) -> DataFrame: ...
380380

381-
382381
@overload
383382
def read_sql_query(
384383
sql,
385384
con,
386385
index_col: str | list[str] | None = ...,
387386
coerce_float=...,
388387
params: list[Any] | Mapping[str, Any] | None = ...,
389-
parse_dates: list[str] | dict[str, str] | None = ...,
388+
parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ...,
390389
chunksize: int = ...,
391390
dtype: DtypeArg | None = ...,
392391
dtype_backend: DtypeBackend | lib.NoDefault = ...,
@@ -399,7 +398,7 @@ def read_sql_query(
399398
index_col: str | list[str] | None = None,
400399
coerce_float: bool = True,
401400
params: list[Any] | Mapping[str, Any] | None = None,
402-
parse_dates: list[str] | dict[str, str] | None = None,
401+
parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = None,
403402
chunksize: int | None = None,
404403
dtype: DtypeArg | None = None,
405404
dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default,

0 commit comments

Comments
 (0)