Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
else:
npt: Any = None

HashableT = TypeVar("HashableT", bound=Hashable)

# array-like

Expand Down
19 changes: 11 additions & 8 deletions pandas/core/reshape/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

import numpy as np

from pandas._typing import Axis
from pandas._typing import (
Axis,
HashableT,
)
from pandas.util._decorators import (
cache_readonly,
deprecate_nonkeyword_arguments,
Expand Down Expand Up @@ -62,7 +65,7 @@

@overload
def concat(
objs: Iterable[DataFrame] | Mapping[Hashable, DataFrame],
objs: Iterable[DataFrame] | Mapping[HashableT, DataFrame],
axis: Literal[0, "index"] = ...,
join: str = ...,
ignore_index: bool = ...,
Expand All @@ -78,7 +81,7 @@ def concat(

@overload
def concat(
objs: Iterable[Series] | Mapping[Hashable, Series],
objs: Iterable[Series] | Mapping[HashableT, Series],
axis: Literal[0, "index"] = ...,
join: str = ...,
ignore_index: bool = ...,
Expand All @@ -94,7 +97,7 @@ def concat(

@overload
def concat(
objs: Iterable[NDFrame] | Mapping[Hashable, NDFrame],
objs: Iterable[NDFrame] | Mapping[HashableT, NDFrame],
axis: Literal[0, "index"] = ...,
join: str = ...,
ignore_index: bool = ...,
Expand All @@ -110,7 +113,7 @@ def concat(

@overload
def concat(
objs: Iterable[NDFrame] | Mapping[Hashable, NDFrame],
objs: Iterable[NDFrame] | Mapping[HashableT, NDFrame],
axis: Literal[1, "columns"],
join: str = ...,
ignore_index: bool = ...,
Expand All @@ -126,7 +129,7 @@ def concat(

@overload
def concat(
objs: Iterable[NDFrame] | Mapping[Hashable, NDFrame],
objs: Iterable[NDFrame] | Mapping[HashableT, NDFrame],
axis: Axis = ...,
join: str = ...,
ignore_index: bool = ...,
Expand All @@ -142,7 +145,7 @@ def concat(

@deprecate_nonkeyword_arguments(version=None, allowed_args=["objs"])
def concat(
objs: Iterable[NDFrame] | Mapping[Hashable, NDFrame],
objs: Iterable[NDFrame] | Mapping[HashableT, NDFrame],
axis: Axis = 0,
join: str = "outer",
ignore_index: bool = False,
Expand Down Expand Up @@ -367,7 +370,7 @@ class _Concatenator:

def __init__(
self,
objs: Iterable[NDFrame] | Mapping[Hashable, NDFrame],
objs: Iterable[NDFrame] | Mapping[HashableT, NDFrame],
axis=0,
join: str = "outer",
keys=None,
Expand Down