File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
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
+ option_context ,
15
15
)
16
16
import pandas ._testing as tm
17
17
from pandas .core .strings .accessor import StringMethods
@@ -783,8 +783,8 @@ def test_series_str_decode():
783
783
784
784
def test_decode_with_dtype_none ():
785
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 )
786
+ with option_context ("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