@@ -95,6 +95,7 @@ def test_repeat_with_null(any_string_dtype, arg, repeat):
9595
9696def test_empty_str_methods (any_string_dtype ):
9797 empty_str = empty = Series (dtype = any_string_dtype )
98+ empty_inferred_str = Series (dtype = "str" )
9899 if is_object_or_nan_string_dtype (any_string_dtype ):
99100 empty_int = Series (dtype = "int64" )
100101 empty_bool = Series (dtype = bool )
@@ -154,7 +155,7 @@ def test_empty_str_methods(any_string_dtype):
154155 tm .assert_series_equal (empty_str , empty .str .rstrip ())
155156 tm .assert_series_equal (empty_str , empty .str .wrap (42 ))
156157 tm .assert_series_equal (empty_str , empty .str .get (0 ))
157- tm .assert_series_equal (empty_object , empty_bytes .str .decode ("ascii" ))
158+ tm .assert_series_equal (empty_inferred_str , empty_bytes .str .decode ("ascii" ))
158159 tm .assert_series_equal (empty_bytes , empty .str .encode ("ascii" ))
159160 # ismethods should always return boolean (GH 29624)
160161 tm .assert_series_equal (empty_bool , empty .str .isalnum ())
@@ -596,7 +597,7 @@ def test_decode_errors_kwarg():
596597 ser .str .decode ("cp1252" )
597598
598599 result = ser .str .decode ("cp1252" , "ignore" )
599- expected = ser .map (lambda x : x .decode ("cp1252" , "ignore" )).astype (object )
600+ expected = ser .map (lambda x : x .decode ("cp1252" , "ignore" )).astype ("str" )
600601 tm .assert_series_equal (result , expected )
601602
602603
@@ -751,5 +752,5 @@ def test_get_with_dict_label():
751752def test_series_str_decode ():
752753 # GH 22613
753754 result = Series ([b"x" , b"y" ]).str .decode (encoding = "UTF-8" , errors = "strict" )
754- expected = Series (["x" , "y" ], dtype = "object " )
755+ expected = Series (["x" , "y" ], dtype = "str " )
755756 tm .assert_series_equal (result , expected )
0 commit comments