Skip to content

Trying to make pd.concat work with pyright strict mode. #955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
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
17 changes: 10 additions & 7 deletions pandas-stubs/core/reshape/concat.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ from collections.abc import (
Sequence,
)
from typing import (
Any,
Literal,
overload,
)
Expand Down Expand Up @@ -39,7 +40,7 @@ def concat(
) -> DataFrame: ...
@overload
def concat( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
objs: Iterable[Series] | Mapping[HashableT1, Series],
objs: Iterable[Series[Any]] | Mapping[HashableT1, Series[Any]],
*,
axis: AxisIndex = ...,
join: Literal["inner", "outer"] = ...,
Expand All @@ -50,10 +51,12 @@ def concat( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappin
verify_integrity: bool = ...,
sort: bool = ...,
copy: bool = ...,
) -> Series: ...
) -> Series[Any]: ...
@overload
def concat( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
objs: Iterable[Series | DataFrame] | Mapping[HashableT1, Series | DataFrame],
objs: (
Iterable[Series[Any] | DataFrame] | Mapping[HashableT1, Series[Any] | DataFrame]
),
*,
axis: Axis = ...,
join: Literal["inner", "outer"] = ...,
Expand Down Expand Up @@ -95,7 +98,7 @@ def concat( # type: ignore[overload-overlap]
) -> DataFrame: ...
@overload
def concat( # type: ignore[overload-overlap]
objs: Iterable[Series | None] | Mapping[HashableT1, Series | None],
objs: Iterable[Series[Any] | None] | Mapping[HashableT1, Series[Any] | None],
*,
axis: AxisIndex = ...,
join: Literal["inner", "outer"] = ...,
Expand All @@ -106,12 +109,12 @@ def concat( # type: ignore[overload-overlap]
verify_integrity: bool = ...,
sort: bool = ...,
copy: bool = ...,
) -> Series: ...
) -> Series[Any]: ...
@overload
def concat(
objs: (
Iterable[Series | DataFrame | None]
| Mapping[HashableT1, Series | DataFrame | None]
Iterable[Series[Any] | DataFrame | None]
| Mapping[HashableT1, Series[Any] | DataFrame | None]
),
*,
axis: Axis = ...,
Expand Down
Loading