Skip to content

Commit 7aef72c

Browse files
author
joy-rosie
committed
add tests and add to _isna_old
1 parent f1cbf4f commit 7aef72c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pandas/core/dtypes/missing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ def _isna_old(obj):
173173
# hack (for now) because MI registers as ndarray
174174
elif isinstance(obj, ABCMultiIndex):
175175
raise NotImplementedError("isna is not defined for MultiIndex")
176+
elif isinstance(obj, type):
177+
return False
176178
elif isinstance(obj, (ABCSeries, np.ndarray, ABCIndexClass)):
177179
return _isna_ndarraylike_old(obj)
178180
elif isinstance(obj, ABCGeneric):

pandas/tests/dtypes/test_missing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ def test_isna_isnull(self, isna_f):
8686
assert not isna_f(np.inf)
8787
assert not isna_f(-np.inf)
8888

89+
# type
90+
assert not isna_f(type(pd.Series()))
91+
assert not isna_f(type(pd.DataFrame()))
92+
8993
# series
9094
for s in [
9195
tm.makeFloatSeries(),

0 commit comments

Comments
 (0)