Skip to content

Commit 6df137f

Browse files
authored
Fixing some types
1 parent 1b5b02c commit 6df137f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

pandas/io/excel/_base.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,13 @@
360360

361361
@overload
362362
def read_excel(
363-
io,
363+
io: Any,
364364
# sheet name is str or int -> DataFrame
365365
sheet_name: str | int = ...,
366366
*,
367367
header: int | Sequence[int] | None = ...,
368368
names: SequenceNotStr[Hashable] | range | None = ...,
369-
index_col: int | str | Sequence[int] | None = ...,
369+
index_col: int | Sequence[int] | None = ...,
370370
usecols: int
371371
| str
372372
| Sequence[int]
@@ -375,16 +375,16 @@ def read_excel(
375375
| None = ...,
376376
dtype: DtypeArg | None = ...,
377377
engine: Literal["xlrd", "openpyxl", "odf", "pyxlsb", "calamine"] | None = ...,
378-
converters: dict[str, Callable] | dict[int, Callable] | None = ...,
378+
converters: dict[str, Callable[..., Any]] | dict[int, Callable[..., Any]] | None = ...,
379379
true_values: Iterable[Hashable] | None = ...,
380380
false_values: Iterable[Hashable] | None = ...,
381381
skiprows: Sequence[int] | int | Callable[[int], object] | None = ...,
382382
nrows: int | None = ...,
383-
na_values=...,
383+
na_values: Any =...,
384384
keep_default_na: bool = ...,
385385
na_filter: bool = ...,
386386
verbose: bool = ...,
387-
parse_dates: list | dict | bool = ...,
387+
parse_dates: list[Any] | dict[Any, Any] | bool = ...,
388388
date_format: dict[Hashable, str] | str | None = ...,
389389
thousands: str | None = ...,
390390
decimal: str = ...,
@@ -397,13 +397,13 @@ def read_excel(
397397

398398
@overload
399399
def read_excel(
400-
io,
400+
io: Any,
401401
# sheet name is list or None -> dict[IntStrT, DataFrame]
402402
sheet_name: list[IntStrT] | None,
403403
*,
404404
header: int | Sequence[int] | None = ...,
405405
names: SequenceNotStr[Hashable] | range | None = ...,
406-
index_col: int | str | Sequence[int] | None = ...,
406+
index_col: int | Sequence[int] | None = ...,
407407
usecols: int
408408
| str
409409
| Sequence[int]
@@ -412,16 +412,16 @@ def read_excel(
412412
| None = ...,
413413
dtype: DtypeArg | None = ...,
414414
engine: Literal["xlrd", "openpyxl", "odf", "pyxlsb", "calamine"] | None = ...,
415-
converters: dict[str, Callable] | dict[int, Callable] | None = ...,
415+
converters: dict[str, Callable[..., Any]] | dict[int, Callable[..., Any]] | None = ...,
416416
true_values: Iterable[Hashable] | None = ...,
417417
false_values: Iterable[Hashable] | None = ...,
418418
skiprows: Sequence[int] | int | Callable[[int], object] | None = ...,
419419
nrows: int | None = ...,
420-
na_values=...,
420+
na_values: Any =...,
421421
keep_default_na: bool = ...,
422422
na_filter: bool = ...,
423423
verbose: bool = ...,
424-
parse_dates: list | dict | bool = ...,
424+
parse_dates: list[Any] | dict[Any, Any] | bool = ...,
425425
date_format: dict[Hashable, str] | str | None = ...,
426426
thousands: str | None = ...,
427427
decimal: str = ...,
@@ -436,12 +436,12 @@ def read_excel(
436436
@doc(storage_options=_shared_docs["storage_options"])
437437
@Appender(_read_excel_doc)
438438
def read_excel(
439-
io,
439+
io: Any,
440440
sheet_name: str | int | list[IntStrT] | None = 0,
441441
*,
442442
header: int | Sequence[int] | None = 0,
443443
names: SequenceNotStr[Hashable] | range | None = None,
444-
index_col: int | str | Sequence[int] | None = None,
444+
index_col: int | Sequence[int] | None = None,
445445
usecols: int
446446
| str
447447
| Sequence[int]
@@ -450,24 +450,24 @@ def read_excel(
450450
| None = None,
451451
dtype: DtypeArg | None = None,
452452
engine: Literal["xlrd", "openpyxl", "odf", "pyxlsb", "calamine"] | None = None,
453-
converters: dict[str, Callable] | dict[int, Callable] | None = None,
453+
converters: dict[str, Callable[..., Any]] | dict[int, Callable[..., Any]] | None = None,
454454
true_values: Iterable[Hashable] | None = None,
455455
false_values: Iterable[Hashable] | None = None,
456456
skiprows: Sequence[int] | int | Callable[[int], object] | None = None,
457457
nrows: int | None = None,
458-
na_values=None,
458+
na_values: Any = None,
459459
keep_default_na: bool = True,
460460
na_filter: bool = True,
461461
verbose: bool = False,
462-
parse_dates: list | dict | bool = False,
462+
parse_dates: list[Any] | dict[Any, Any] | bool = False,
463463
date_format: dict[Hashable, str] | str | None = None,
464464
thousands: str | None = None,
465465
decimal: str = ".",
466466
comment: str | None = None,
467467
skipfooter: int = 0,
468468
storage_options: StorageOptions | None = None,
469469
dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default,
470-
engine_kwargs: dict | None = None,
470+
engine_kwargs: dict[Any, Any] | None = None,
471471
) -> DataFrame | dict[IntStrT, DataFrame]:
472472
check_dtype_backend(dtype_backend)
473473
should_close = False
@@ -1606,7 +1606,7 @@ def __fspath__(self):
16061606

16071607
def parse(
16081608
self,
1609-
sheet_name: str | int | list[int] | list[str] | None = 0,
1609+
sheet_name: str | int | list[IntStrT] | None = 0,
16101610
header: int | Sequence[int] | None = 0,
16111611
names: SequenceNotStr[Hashable] | range | None = None,
16121612
index_col: int | Sequence[int] | None = None,
@@ -1624,7 +1624,7 @@ def parse(
16241624
skipfooter: int = 0,
16251625
dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default,
16261626
**kwds,
1627-
) -> DataFrame | dict[str, DataFrame] | dict[int, DataFrame]:
1627+
) -> DataFrame | dict[IntStrT, DataFrame]:
16281628
"""
16291629
Parse specified sheet(s) into a DataFrame.
16301630

0 commit comments

Comments
 (0)