Skip to content

Commit

Permalink
TYP: read_csv and read_excel fixes (#55410)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoertwein authored Oct 5, 2023
1 parent e4b7174 commit 940a1b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
11 changes: 6 additions & 5 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
IntStrT,
ReadBuffer,
Self,
SequenceNotStr,
StorageOptions,
WriteExcelBuffer,
)
Expand Down Expand Up @@ -387,7 +388,7 @@ def read_excel(
sheet_name: str | int = ...,
*,
header: int | Sequence[int] | None = ...,
names: list[str] | None = ...,
names: SequenceNotStr[Hashable] | range | None = ...,
index_col: int | Sequence[int] | None = ...,
usecols: int
| str
Expand Down Expand Up @@ -426,7 +427,7 @@ def read_excel(
sheet_name: list[IntStrT] | None,
*,
header: int | Sequence[int] | None = ...,
names: list[str] | None = ...,
names: SequenceNotStr[Hashable] | range | None = ...,
index_col: int | Sequence[int] | None = ...,
usecols: int
| str
Expand Down Expand Up @@ -465,7 +466,7 @@ def read_excel(
sheet_name: str | int | list[IntStrT] | None = 0,
*,
header: int | Sequence[int] | None = 0,
names: list[str] | None = None,
names: SequenceNotStr[Hashable] | range | None = None,
index_col: int | Sequence[int] | None = None,
usecols: int
| str
Expand Down Expand Up @@ -730,7 +731,7 @@ def parse(
self,
sheet_name: str | int | list[int] | list[str] | None = 0,
header: int | Sequence[int] | None = 0,
names=None,
names: SequenceNotStr[Hashable] | range | None = None,
index_col: int | Sequence[int] | None = None,
usecols=None,
dtype: DtypeArg | None = None,
Expand Down Expand Up @@ -1589,7 +1590,7 @@ def parse(
self,
sheet_name: str | int | list[int] | list[str] | None = 0,
header: int | Sequence[int] | None = 0,
names=None,
names: SequenceNotStr[Hashable] | range | None = None,
index_col: int | Sequence[int] | None = None,
usecols=None,
converters=None,
Expand Down
20 changes: 10 additions & 10 deletions pandas/io/parsers/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def read_csv(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: Literal[True],
Expand Down Expand Up @@ -726,7 +726,7 @@ def read_csv(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: bool = ...,
Expand Down Expand Up @@ -786,7 +786,7 @@ def read_csv(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: Literal[False] = ...,
Expand Down Expand Up @@ -846,7 +846,7 @@ def read_csv(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: bool = ...,
Expand Down Expand Up @@ -920,7 +920,7 @@ def read_csv(
infer_datetime_format: bool | lib.NoDefault = lib.no_default,
keep_date_col: bool = False,
date_parser: Callable | lib.NoDefault = lib.no_default,
date_format: str | None = None,
date_format: str | dict[Hashable, str] | None = None,
dayfirst: bool = False,
cache_dates: bool = True,
# Iteration
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def read_table(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: Literal[True],
Expand Down Expand Up @@ -1066,7 +1066,7 @@ def read_table(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: bool = ...,
Expand Down Expand Up @@ -1123,7 +1123,7 @@ def read_table(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: Literal[False] = ...,
Expand Down Expand Up @@ -1180,7 +1180,7 @@ def read_table(
infer_datetime_format: bool | lib.NoDefault = ...,
keep_date_col: bool = ...,
date_parser: Callable | lib.NoDefault = ...,
date_format: str | None = ...,
date_format: str | dict[Hashable, str] | None = ...,
dayfirst: bool = ...,
cache_dates: bool = ...,
iterator: bool = ...,
Expand Down Expand Up @@ -1253,7 +1253,7 @@ def read_table(
infer_datetime_format: bool | lib.NoDefault = lib.no_default,
keep_date_col: bool = False,
date_parser: Callable | lib.NoDefault = lib.no_default,
date_format: str | None = None,
date_format: str | dict[Hashable, str] | None = None,
dayfirst: bool = False,
cache_dates: bool = True,
# Iteration
Expand Down

0 comments on commit 940a1b4

Please sign in to comment.