18
18
is_object_dtype ,
19
19
needs_i8_conversion ,
20
20
)
21
+ from pandas .core .dtypes .generic import ABCIndex , ABCMultiIndex
21
22
22
23
import pandas as pd
23
24
from pandas import (
@@ -727,12 +728,12 @@ def test_fillna(self, index_or_series_obj):
727
728
obj = index_or_series_obj
728
729
if len (obj ) == 0 :
729
730
pytest .skip ("Test doesn't make sense on empty data" )
730
- elif isinstance (obj , pd . MultiIndex ):
731
+ elif isinstance (obj , ABCMultiIndex ):
731
732
pytest .skip ("MultiIndex doesn't support isna" )
732
733
733
734
# values will not be changed
734
735
result = obj .fillna (obj .values [0 ])
735
- if isinstance (obj , Index ):
736
+ if isinstance (obj , ABCIndex ):
736
737
tm .assert_index_equal (obj , result )
737
738
else :
738
739
tm .assert_series_equal (obj , result )
@@ -752,7 +753,7 @@ def test_fillna_null(self, null_obj, index_or_series_obj):
752
753
pytest .skip (f"{ klass } doesn't allow for NA operations" )
753
754
elif len (obj ) < 1 :
754
755
pytest .skip ("Test doesn't make sense on empty data" )
755
- elif isinstance (obj , pd . MultiIndex ):
756
+ elif isinstance (obj , ABCMultiIndex ):
756
757
pytest .skip (f"MultiIndex can't hold '{ null_obj } '" )
757
758
758
759
values = obj .values
@@ -769,7 +770,7 @@ def test_fillna_null(self, null_obj, index_or_series_obj):
769
770
obj = klass (values )
770
771
771
772
result = obj .fillna (fill_value )
772
- if isinstance (obj , Index ):
773
+ if isinstance (obj , ABCIndex ):
773
774
tm .assert_index_equal (result , expected )
774
775
else :
775
776
tm .assert_series_equal (result , expected )
0 commit comments