@@ -2278,7 +2278,7 @@ def convert(
22782278 except UnicodeEncodeError as err :
22792279 if (
22802280 errors == "surrogatepass"
2281- and get_option ( "future.infer_string" )
2281+ and using_string_dtype ( )
22822282 and str (err ).endswith ("surrogates not allowed" )
22832283 and HAS_PYARROW
22842284 ):
@@ -3214,7 +3214,7 @@ def read_index_node(
32143214 except UnicodeEncodeError as err :
32153215 if (
32163216 self .errors == "surrogatepass"
3217- and get_option ( "future.infer_string" )
3217+ and using_string_dtype ( )
32183218 and str (err ).endswith ("surrogates not allowed" )
32193219 and HAS_PYARROW
32203220 ):
@@ -3365,7 +3365,7 @@ def read(
33653365 except UnicodeEncodeError as err :
33663366 if (
33673367 self .errors == "surrogatepass"
3368- and get_option ( "future.infer_string" )
3368+ and using_string_dtype ( )
33693369 and str (err ).endswith ("surrogates not allowed" )
33703370 and HAS_PYARROW
33713371 ):
@@ -4829,7 +4829,7 @@ def read(
48294829 except UnicodeEncodeError as err :
48304830 if (
48314831 self .errors == "surrogatepass"
4832- and get_option ( "future.infer_string" )
4832+ and using_string_dtype ( )
48334833 and str (err ).endswith ("surrogates not allowed" )
48344834 and HAS_PYARROW
48354835 ):
0 commit comments