@@ -709,7 +709,7 @@ def test_excel_date_datetime_format(self, ext, path):
709
709
# we need to use df_expected to check the result.
710
710
tm .assert_frame_equal (rs2 , df_expected )
711
711
712
- def test_to_excel_interval_no_labels (self , path ):
712
+ def test_to_excel_interval_no_labels (self , path , using_infer_string ):
713
713
# see gh-19242
714
714
#
715
715
# Test writing Interval without labels.
@@ -719,7 +719,9 @@ def test_to_excel_interval_no_labels(self, path):
719
719
expected = df .copy ()
720
720
721
721
df ["new" ] = pd .cut (df [0 ], 10 )
722
- expected ["new" ] = pd .cut (expected [0 ], 10 ).astype (str )
722
+ expected ["new" ] = pd .cut (expected [0 ], 10 ).astype (
723
+ str if not using_infer_string else "string[pyarrow_numpy]"
724
+ )
723
725
724
726
df .to_excel (path , sheet_name = "test1" )
725
727
with ExcelFile (path ) as reader :
@@ -1213,10 +1215,9 @@ def test_render_as_column_name(self, path):
1213
1215
1214
1216
def test_true_and_false_value_options (self , path ):
1215
1217
# see gh-13347
1216
- df = DataFrame ([["foo" , "bar" ]], columns = ["col1" , "col2" ])
1217
- msg = "Downcasting behavior in `replace`"
1218
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1219
- expected = df .replace ({"foo" : True , "bar" : False })
1218
+ df = DataFrame ([["foo" , "bar" ]], columns = ["col1" , "col2" ], dtype = object )
1219
+ with option_context ("future.no_silent_downcasting" , True ):
1220
+ expected = df .replace ({"foo" : True , "bar" : False }).astype ("bool" )
1220
1221
1221
1222
df .to_excel (path )
1222
1223
read_frame = pd .read_excel (
0 commit comments