Skip to content

Commit

Permalink
ENH: set __module__ on isna and notna (#60271)
Browse files Browse the repository at this point in the history
  • Loading branch information
SiemBerhane authored Nov 12, 2024
1 parent 22df68e commit 5f23ace
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
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

0 comments on commit 5f23ace

Please sign in to comment.