|
1 | 1 | from pandas import DataFrame as DataFrame, Index as Index, MultiIndex as MultiIndex, Series as Series |
2 | | -from pandas._typing import Axis, FrameOrSeries |
| 2 | +from pandas._typing import Axis, FrameOrSeries, Label |
3 | 3 | from pandas.core.arrays.categorical import factorize_from_iterable as factorize_from_iterable, factorize_from_iterables as factorize_from_iterables |
4 | 4 | from pandas.core.generic import NDFrame as NDFrame |
5 | 5 | from pandas.core.indexes.api import all_indexes_same as all_indexes_same, ensure_index as ensure_index, get_consensus_names as get_consensus_names, get_objs_combined_axis as get_objs_combined_axis |
6 | 6 | from pandas.core.internals import concatenate_block_managers as concatenate_block_managers |
7 | | -from typing import Any, Hashable, Iterable, Mapping, Optional, Union, overload |
8 | | - |
| 7 | +from typing import Any, Iterable, Mapping, overload |
9 | 8 |
|
| 9 | +# For some reason mypy won't read this declaration correctly if we use 2 overloads with union |
| 10 | +@overload |
| 11 | +def concat(objs: Iterable[DataFrame], axis: Axis = ..., join: str=..., ignore_index: bool=..., keys: Any = ..., levels: Any = ..., names: Any = ..., verify_integrity: bool=..., sort: bool=..., copy: bool=...) -> DataFrame: ... |
| 12 | +@overload |
| 13 | +def concat(objs: Mapping[Label, DataFrame], axis: Axis = ..., join: str=..., ignore_index: bool=..., keys: Any = ..., levels: Any = ..., names: Any = ..., verify_integrity: bool=..., sort: bool=..., copy: bool=...) -> DataFrame: ... |
10 | 14 | @overload |
11 | | -def concat(objs: Union[Iterable[DataFrame], Mapping[Optional[Hashable], DataFrame]], axis: Axis = ..., join: str=..., ignore_index: bool=..., keys: Any = ..., levels: Any = ..., names: Any = ..., verify_integrity: bool=..., sort: bool=..., copy: bool=...) -> DataFrame: ... |
| 15 | +def concat(objs: Iterable[Series], axis: Axis = ..., join: str=..., ignore_index: bool=..., keys: Any = ..., levels: Any = ..., names: Any = ..., verify_integrity: bool=..., sort: bool=..., copy: bool=...) -> FrameOrSeries: ... |
12 | 16 | @overload |
13 | | -def concat(objs: Union[Iterable[Series], Mapping[Optional[Hashable], Series]], axis: Axis = ..., join: str=..., ignore_index: bool=..., keys: Any = ..., levels: Any = ..., names: Any = ..., verify_integrity: bool=..., sort: bool=..., copy: bool=...) -> FrameOrSeries: ... |
| 17 | +def concat(objs: Mapping[Label, Series], axis: Axis = ..., join: str=..., ignore_index: bool=..., keys: Any = ..., levels: Any = ..., names: Any = ..., verify_integrity: bool=..., sort: bool=..., copy: bool=...) -> FrameOrSeries: ... |
14 | 18 |
|
15 | 19 | class _Concatenator: |
16 | 20 | intersect: bool = ... |
|
0 commit comments