Skip to content

Commit 942c56b

Browse files
authored
CLN: Replace get_option(infer_string) with using_string_dtype (#63036)
1 parent 9b82f96 commit 942c56b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pandas/core/strings/accessor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import numpy as np
1414

15-
from pandas._config import get_option
15+
from pandas._config import using_string_dtype
1616

1717
from pandas._libs import lib
1818
from pandas._typing import (
@@ -2123,7 +2123,7 @@ def decode(
21232123
"""
21242124
if dtype is not None and not is_string_dtype(dtype):
21252125
raise ValueError(f"dtype must be string or object, got {dtype=}")
2126-
if dtype is None and get_option("future.infer_string"):
2126+
if dtype is None and using_string_dtype():
21272127
dtype = "str"
21282128
# TODO: Add a similar _bytes interface.
21292129
if encoding in _cpython_optimized_decoders:

pandas/io/pytables.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
):

pandas/io/sas/sas7bdat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import numpy as np
2424

25-
from pandas._config import get_option
25+
from pandas._config import using_string_dtype
2626

2727
from pandas._libs.byteswap import (
2828
read_double_with_byteswap,
@@ -699,7 +699,7 @@ def _chunk_to_dataframe(self) -> DataFrame:
699699
rslt = {}
700700

701701
js, jb = 0, 0
702-
infer_string = get_option("future.infer_string")
702+
infer_string = using_string_dtype()
703703
for j in range(self.column_count):
704704
name = self.column_names[j]
705705

0 commit comments

Comments
 (0)