Skip to content

Add type parameters to generics in isna and notna #945

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 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pandas-stubs/_typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ from pandas.io.formats.format import EngFormatter
# where it is the only acceptable type.
Incomplete: TypeAlias = Any

ArrayLike: TypeAlias = ExtensionArray | np.ndarray
ArrayLike: TypeAlias = ExtensionArray | np.ndarray[Any, Any]
AnyArrayLike: TypeAlias = Index | Series | np.ndarray
PythonScalar: TypeAlias = str | bool | complex
DatetimeLikeScalar = TypeVar("DatetimeLikeScalar", Period, Timestamp, Timedelta)
Expand Down
13 changes: 8 additions & 5 deletions pandas-stubs/core/dtypes/missing.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import overload
from typing import (
Any,
overload,
)

import numpy as np
from numpy import typing as npt
Expand All @@ -23,9 +26,9 @@ isneginf_scalar = ...
@overload
def isna(obj: DataFrame) -> DataFrame: ...
@overload
def isna(obj: Series) -> Series[bool]: ...
def isna(obj: Series[Any]) -> Series[bool]: ...
@overload
def isna(obj: Index | list | ArrayLike) -> npt.NDArray[np.bool_]: ...
def isna(obj: Index[Any] | list[Any] | ArrayLike) -> npt.NDArray[np.bool_]: ...
@overload
def isna(
obj: Scalar | NaTType | NAType | None,
Expand All @@ -36,9 +39,9 @@ isnull = isna
@overload
def notna(obj: DataFrame) -> DataFrame: ...
@overload
def notna(obj: Series) -> Series[bool]: ...
def notna(obj: Series[Any]) -> Series[bool]: ...
@overload
def notna(obj: Index | list | ArrayLike) -> npt.NDArray[np.bool_]: ...
def notna(obj: Index[Any] | list[Any] | ArrayLike) -> npt.NDArray[np.bool_]: ...
@overload
def notna(obj: ScalarT | NaTType | NAType | None) -> TypeGuard[ScalarT]: ...

Expand Down
Loading