@@ -39,6 +39,11 @@ class SettingWithCopyWarning(Warning):
39
39
class AmbiguousIndexError (PandasError , KeyError ):
40
40
pass
41
41
42
+ class AbstractMethodError (NotImplementedError ):
43
+ def __init__ (self ,m ):
44
+ self .message = m
45
+ def __str__ (self ):
46
+ return "This method must be defined on the concrete class - " + self .message
42
47
43
48
_POSSIBLY_CAST_DTYPES = set ([np .dtype (t ).name
44
49
for t in ['O' , 'int8' ,
@@ -134,7 +139,7 @@ def _isnull_new(obj):
134
139
return lib .checknull (obj )
135
140
# hack (for now) because MI registers as ndarray
136
141
elif isinstance (obj , pd .MultiIndex ):
137
- raise NotImplementedError ("isnull is not defined for MultiIndex" )
142
+ raise AbstractMethodError ("isnull is not defined for MultiIndex" )
138
143
elif isinstance (obj , (ABCSeries , np .ndarray )):
139
144
return _isnull_ndarraylike (obj )
140
145
elif isinstance (obj , ABCGeneric ):
@@ -160,7 +165,7 @@ def _isnull_old(obj):
160
165
return lib .checknull_old (obj )
161
166
# hack (for now) because MI registers as ndarray
162
167
elif isinstance (obj , pd .MultiIndex ):
163
- raise NotImplementedError ("isnull is not defined for MultiIndex" )
168
+ raise AbstractMethodError ("isnull is not defined for MultiIndex" )
164
169
elif isinstance (obj , (ABCSeries , np .ndarray )):
165
170
return _isnull_ndarraylike_old (obj )
166
171
elif isinstance (obj , ABCGeneric ):
0 commit comments