File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11
11
Index ,
12
12
MultiIndex ,
13
13
Series ,
14
+ set_option ,
14
15
)
15
16
import pandas ._testing as tm
16
17
from pandas .core .strings .accessor import StringMethods
@@ -778,3 +779,12 @@ def test_series_str_decode():
778
779
result = Series ([b"x" , b"y" ]).str .decode (encoding = "UTF-8" , errors = "strict" )
779
780
expected = Series (["x" , "y" ], dtype = "str" )
780
781
tm .assert_series_equal (result , expected )
782
+
783
+
784
+ def test_decode_with_dtype_none ():
785
+ # Ensure that future.infer_string is enabled
786
+ set_option ("future.infer_string" , True )
787
+ ser = Series ([b"a" , b"b" , b"c" ]) # Use byte strings
788
+ result = ser .str .decode ("utf-8" , dtype = None )
789
+ expected = Series (["a" , "b" , "c" ], dtype = "str" )
790
+ tm .assert_series_equal (result , expected )
You can’t perform that action at this time.
0 commit comments