Skip to content

Commit 5f23ace

Browse files
authored
ENH: set __module__ on isna and notna (#60271)
1 parent 22df68e commit 5f23ace

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pandas/core/dtypes/missing.py

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
NaT,
2020
iNaT,
2121
)
22+
from pandas.util._decorators import set_module
2223

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

9596

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

309311

312+
@set_module("pandas")
310313
def notna(obj: object) -> bool | npt.NDArray[np.bool_] | NDFrame:
311314
"""
312315
Detect non-missing values for an array-like object.

pandas/tests/api/test_api.py

+2
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ def test_set_module():
417417
assert pd.Period.__module__ == "pandas"
418418
assert pd.Timestamp.__module__ == "pandas"
419419
assert pd.Timedelta.__module__ == "pandas"
420+
assert pd.isna.__module__ == "pandas"
421+
assert pd.notna.__module__ == "pandas"
420422
assert pd.merge.__module__ == "pandas"
421423
assert pd.merge_ordered.__module__ == "pandas"
422424
assert pd.merge_asof.__module__ == "pandas"

0 commit comments

Comments
 (0)