Skip to content

Commit 9e8bb8e

Browse files
use 'auto' instead of None
1 parent ee91760 commit 9e8bb8e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pandas/core/arrays/string_.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,15 @@ def __init__(
141141
if storage is None:
142142
if na_value is not libmissing.NA:
143143
storage = get_option("mode.string_storage")
144-
if storage is None:
144+
if storage == "auto":
145145
if HAS_PYARROW:
146146
storage = "pyarrow"
147147
else:
148148
storage = "python"
149149
else:
150-
storage = get_option("mode.string_storage") or "python"
150+
storage = get_option("mode.string_storage")
151+
if storage == "auto":
152+
storage = "python"
151153

152154
if storage == "pyarrow_numpy":
153155
# TODO raise a deprecation warning

pandas/core/config_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def is_terminal() -> bool:
457457

458458

459459
def is_valid_string_storage(value: Any) -> None:
460-
legal_values = [None, "python", "pyarrow"]
460+
legal_values = ["auto", "python", "pyarrow"]
461461
if value not in legal_values:
462462
msg = "Value must be one of python|pyarrow"
463463
if value == "pyarrow_numpy":
@@ -472,7 +472,7 @@ def is_valid_string_storage(value: Any) -> None:
472472
with cf.config_prefix("mode"):
473473
cf.register_option(
474474
"string_storage",
475-
None,
475+
"auto",
476476
string_storage_doc,
477477
# validator=is_one_of_factory(["python", "pyarrow"]),
478478
validator=is_valid_string_storage,

0 commit comments

Comments
 (0)