@@ -95,6 +95,7 @@ def test_repeat_with_null(any_string_dtype, arg, repeat):
95
95
96
96
def test_empty_str_methods (any_string_dtype ):
97
97
empty_str = empty = Series (dtype = any_string_dtype )
98
+ empty_inferred_str = Series (dtype = "str" )
98
99
if is_object_or_nan_string_dtype (any_string_dtype ):
99
100
empty_int = Series (dtype = "int64" )
100
101
empty_bool = Series (dtype = bool )
@@ -154,7 +155,7 @@ def test_empty_str_methods(any_string_dtype):
154
155
tm .assert_series_equal (empty_str , empty .str .rstrip ())
155
156
tm .assert_series_equal (empty_str , empty .str .wrap (42 ))
156
157
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" ))
158
159
tm .assert_series_equal (empty_bytes , empty .str .encode ("ascii" ))
159
160
# ismethods should always return boolean (GH 29624)
160
161
tm .assert_series_equal (empty_bool , empty .str .isalnum ())
@@ -596,7 +597,7 @@ def test_decode_errors_kwarg():
596
597
ser .str .decode ("cp1252" )
597
598
598
599
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" )
600
601
tm .assert_series_equal (result , expected )
601
602
602
603
@@ -751,5 +752,5 @@ def test_get_with_dict_label():
751
752
def test_series_str_decode ():
752
753
# GH 22613
753
754
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 " )
755
756
tm .assert_series_equal (result , expected )
0 commit comments