@@ -665,9 +665,14 @@ def test_quantile_ea(self, obj, index):
665
665
qs = [0.5 , 0 , 1 ]
666
666
result = self .compute_quantile (obj , qs )
667
667
668
+ exp_dtype = index .dtype
669
+ if index .dtype == "Int64" :
670
+ # match non-nullable casting behavior
671
+ exp_dtype = "Float64"
672
+
668
673
# expected here assumes len(index) == 9
669
674
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"
671
676
)
672
677
expected = type (obj )(expected )
673
678
@@ -712,6 +717,8 @@ def test_quantile_ea_all_na(self, obj, index):
712
717
713
718
expected = index .take ([- 1 , - 1 , - 1 ], allow_fill = True , fill_value = index ._na_value )
714
719
expected = Series (expected , index = qs , name = "A" )
720
+ if expected .dtype == "Int64" :
721
+ expected = expected .astype ("Float64" )
715
722
expected = type (obj )(expected )
716
723
tm .assert_equal (result , expected )
717
724
@@ -726,7 +733,11 @@ def test_quantile_ea_scalar(self, obj, index):
726
733
qs = 0.5
727
734
result = self .compute_quantile (obj , qs )
728
735
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 )
730
741
if isinstance (obj , Series ):
731
742
expected = expected ["A" ]
732
743
assert result == expected
0 commit comments