From 797f99c53f4c07f06460614e3e0197b8552d9031 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Sun, 16 Feb 2025 07:59:27 -0500 Subject: [PATCH] cleanup --- pandas/core/strings/accessor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index 94731d47032d4..955638984aab9 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -2159,8 +2159,8 @@ def decode(self, encoding, errors: str = "strict", dtype: str | DtypeObj = None) f = lambda x: decoder(x, errors)[0] arr = self._data.array result = arr._str_map(f) - if dtype is None: - dtype = "str" if get_option("future.infer_string") else None + if dtype is None and get_option("future.infer_string"): + dtype = "str" return self._wrap_result(result, dtype=dtype) @forbid_nonstring_types(["bytes"])