@@ -552,7 +552,12 @@ def _maybe_downcast(
552552 return blocks
553553
554554 nbs = extend_blocks (
555- [blk .convert (using_cow = using_cow , copy = not using_cow ) for blk in blocks ]
555+ [
556+ blk .convert (
557+ using_cow = using_cow , copy = not using_cow , convert_string = False
558+ )
559+ for blk in blocks
560+ ]
556561 )
557562 if caller == "fillna" :
558563 if len (nbs ) != len (blocks ) or not all (
@@ -625,6 +630,7 @@ def convert(
625630 * ,
626631 copy : bool = True ,
627632 using_cow : bool = False ,
633+ convert_string : bool = True ,
628634 ) -> list [Block ]:
629635 """
630636 Attempt to coerce any object types to better types. Return a copy
@@ -655,6 +661,7 @@ def convert(
655661 res_values = lib .maybe_convert_objects (
656662 values , # type: ignore[arg-type]
657663 convert_non_numeric = True ,
664+ convert_string = convert_string ,
658665 )
659666 refs = None
660667 if (
@@ -904,7 +911,9 @@ def replace(
904911 if get_option ("future.no_silent_downcasting" ) is True :
905912 blocks = [blk ]
906913 else :
907- blocks = blk .convert (copy = False , using_cow = using_cow )
914+ blocks = blk .convert (
915+ copy = False , using_cow = using_cow , convert_string = False
916+ )
908917 if len (blocks ) > 1 or blocks [0 ].dtype != blk .dtype :
909918 warnings .warn (
910919 # GH#54710
@@ -1007,7 +1016,7 @@ def _replace_regex(
10071016 )
10081017 already_warned .warned_already = True
10091018
1010- nbs = block .convert (copy = False , using_cow = using_cow )
1019+ nbs = block .convert (copy = False , using_cow = using_cow , convert_string = False )
10111020 opt = get_option ("future.no_silent_downcasting" )
10121021 if (len (nbs ) > 1 or nbs [0 ].dtype != block .dtype ) and not opt :
10131022 warnings .warn (
@@ -1150,7 +1159,9 @@ def replace_list(
11501159 nbs = []
11511160 for res_blk in result :
11521161 converted = res_blk .convert (
1153- copy = True and not using_cow , using_cow = using_cow
1162+ copy = True and not using_cow ,
1163+ using_cow = using_cow ,
1164+ convert_string = False ,
11541165 )
11551166 if len (converted ) > 1 or converted [0 ].dtype != res_blk .dtype :
11561167 warnings .warn (
0 commit comments