@@ -665,9 +665,14 @@ def test_quantile_ea(self, obj, index):
665665 qs = [0.5 , 0 , 1 ]
666666 result = self .compute_quantile (obj , qs )
667667
668+ exp_dtype = index .dtype
669+ if index .dtype == "Int64" :
670+ # match non-nullable casting behavior
671+ exp_dtype = "Float64"
672+
668673 # expected here assumes len(index) == 9
669674 expected = Series (
670- [index [4 ], index [0 ], index [- 1 ]], dtype = index . dtype , index = qs , name = "A"
675+ [index [4 ], index [0 ], index [- 1 ]], dtype = exp_dtype , index = qs , name = "A"
671676 )
672677 expected = type (obj )(expected )
673678
@@ -712,6 +717,8 @@ def test_quantile_ea_all_na(self, obj, index):
712717
713718 expected = index .take ([- 1 , - 1 , - 1 ], allow_fill = True , fill_value = index ._na_value )
714719 expected = Series (expected , index = qs , name = "A" )
720+ if expected .dtype == "Int64" :
721+ expected = expected .astype ("Float64" )
715722 expected = type (obj )(expected )
716723 tm .assert_equal (result , expected )
717724
@@ -726,7 +733,11 @@ def test_quantile_ea_scalar(self, obj, index):
726733 qs = 0.5
727734 result = self .compute_quantile (obj , qs )
728735
729- expected = Series ({"A" : index [4 ]}, dtype = index .dtype , name = 0.5 )
736+ exp_dtype = index .dtype
737+ if index .dtype == "Int64" :
738+ exp_dtype = "Float64"
739+
740+ expected = Series ({"A" : index [4 ]}, dtype = exp_dtype , name = 0.5 )
730741 if isinstance (obj , Series ):
731742 expected = expected ["A" ]
732743 assert result == expected
0 commit comments