Skip to content

ENH: set __module__ on isna and notna #60271

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 18 commits into from
Nov 12, 2024
3 changes: 3 additions & 0 deletions pandas/core/dtypes/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
NaT,
iNaT,
)
from pandas.util._decorators import set_module

from pandas.core.dtypes.common import (
DT64NS_DTYPE,
Expand Down Expand Up @@ -93,6 +94,7 @@ def isna(
def isna(obj: object) -> bool | npt.NDArray[np.bool_] | NDFrame: ...


@set_module("pandas")
def isna(obj: object) -> bool | npt.NDArray[np.bool_] | NDFrame:
"""
Detect missing values for an array-like object.
Expand Down Expand Up @@ -307,6 +309,7 @@ def notna(
def notna(obj: object) -> bool | npt.NDArray[np.bool_] | NDFrame: ...


@set_module("pandas")
def notna(obj: object) -> bool | npt.NDArray[np.bool_] | NDFrame:
"""
Detect non-missing values for an array-like object.
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ def test_set_module():
assert pd.Period.__module__ == "pandas"
assert pd.Timestamp.__module__ == "pandas"
assert pd.Timedelta.__module__ == "pandas"
assert pd.isna.__module__ == "pandas"
assert pd.notna.__module__ == "pandas"
assert pd.merge.__module__ == "pandas"
assert pd.merge_ordered.__module__ == "pandas"
assert pd.merge_asof.__module__ == "pandas"
Expand Down
Loading