Skip to content

Commit 2596f19

Browse files
committed
Adress review
1 parent a9b4e07 commit 2596f19

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

pandas/io/parsers/base_parser.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
DtypeArg,
3535
FilePath,
3636
ReadCsvBuffer,
37-
Scalar,
3837
)
3938
from pandas.errors import (
4039
ParserError,
@@ -458,9 +457,8 @@ def _maybe_make_multi_index_columns(
458457
) -> Sequence[Hashable] | MultiIndex:
459458
# possibly create a column mi here
460459
if _is_potential_multi_index(columns):
461-
columns = cast(List[Tuple], columns)
462-
return MultiIndex.from_tuples(columns, names=col_names)
463-
columns = cast(List[Scalar], columns)
460+
list_columns = cast(List[Tuple], columns)
461+
return MultiIndex.from_tuples(list_columns, names=col_names)
464462
return columns
465463

466464
@final
@@ -941,13 +939,7 @@ def _check_data_length(
941939

942940
@overload
943941
def _evaluate_usecols(
944-
self, usecols: Callable, names: Sequence[Hashable]
945-
) -> set[int]:
946-
...
947-
948-
@overload
949-
def _evaluate_usecols(
950-
self, usecols: set[int], names: Sequence[Hashable]
942+
self, usecols: set[int] | Callable, names: Sequence[Hashable]
951943
) -> set[int]:
952944
...
953945

pandas/io/parsers/c_parser_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ def _concatenate_chunks(chunks: list[dict[int, ArrayLike]]) -> dict:
414414

415415

416416
def ensure_dtype_objs(
417-
dtype: DtypeArg | Mapping[Hashable, DtypeArg] | None
418-
) -> DtypeObj | Mapping[Hashable, DtypeObj] | None:
417+
dtype: DtypeArg | dict[Hashable, DtypeArg] | None
418+
) -> DtypeObj | dict[Hashable, DtypeObj] | None:
419419
"""
420420
Ensure we have either None, a dtype object, or a dictionary mapping to
421421
dtype objects.

0 commit comments

Comments
 (0)