diff --git a/pandas/tests/strings/test_strings.py b/pandas/tests/strings/test_strings.py index 025f837982595..eac579c2b1031 100644 --- a/pandas/tests/strings/test_strings.py +++ b/pandas/tests/strings/test_strings.py @@ -11,6 +11,7 @@ Index, MultiIndex, Series, + option_context, ) import pandas._testing as tm from pandas.core.strings.accessor import StringMethods @@ -778,3 +779,11 @@ def test_series_str_decode(): result = Series([b"x", b"y"]).str.decode(encoding="UTF-8", errors="strict") expected = Series(["x", "y"], dtype="str") tm.assert_series_equal(result, expected) + + +def test_decode_with_dtype_none(): + with option_context("future.infer_string", True): + ser = Series([b"a", b"b", b"c"]) # Use byte strings + result = ser.str.decode("utf-8", dtype=None) + expected = Series(["a", "b", "c"], dtype="str") + tm.assert_series_equal(result, expected)