7
7
NA ,
8
8
is_matching_na ,
9
9
)
10
- import pandas .util ._test_decorators as td
11
10
12
11
import pandas as pd
13
12
from pandas import Index
@@ -160,14 +159,6 @@ def test_get_indexer_non_unique_np_nats(self, np_nat_fixture, np_nat_fixture2):
160
159
161
160
162
161
class TestSliceLocs :
163
- # TODO(infer_string) parametrize over multiple string dtypes
164
- @pytest .mark .parametrize (
165
- "dtype" ,
166
- [
167
- "object" ,
168
- pytest .param ("string[pyarrow_numpy]" , marks = td .skip_if_no ("pyarrow" )),
169
- ],
170
- )
171
162
@pytest .mark .parametrize (
172
163
"in_slice,expected" ,
173
164
[
@@ -191,24 +182,22 @@ class TestSliceLocs:
191
182
(pd .IndexSlice ["m" :"m" :- 1 ], "" ), # type: ignore[misc]
192
183
],
193
184
)
194
- def test_slice_locs_negative_step (self , in_slice , expected , dtype ):
195
- index = Index (list ("bcdxy" ), dtype = dtype )
185
+ def test_slice_locs_negative_step (self , in_slice , expected , any_string_dtype ):
186
+ index = Index (list ("bcdxy" ), dtype = any_string_dtype )
196
187
197
188
s_start , s_stop = index .slice_locs (in_slice .start , in_slice .stop , in_slice .step )
198
189
result = index [s_start : s_stop : in_slice .step ]
199
- expected = Index (list (expected ), dtype = dtype )
190
+ expected = Index (list (expected ), dtype = any_string_dtype )
200
191
tm .assert_index_equal (result , expected )
201
192
202
- # TODO(infer_string) parametrize over multiple string dtypes
203
- @td .skip_if_no ("pyarrow" )
204
- def test_slice_locs_negative_step_oob (self ):
205
- index = Index (list ("bcdxy" ), dtype = "string[pyarrow_numpy]" )
193
+ def test_slice_locs_negative_step_oob (self , any_string_dtype ):
194
+ index = Index (list ("bcdxy" ), dtype = any_string_dtype )
206
195
207
196
result = index [- 10 :5 :1 ]
208
197
tm .assert_index_equal (result , index )
209
198
210
199
result = index [4 :- 10 :- 1 ]
211
- expected = Index (list ("yxdcb" ), dtype = "string[pyarrow_numpy]" )
200
+ expected = Index (list ("yxdcb" ), dtype = any_string_dtype )
212
201
tm .assert_index_equal (result , expected )
213
202
214
203
def test_slice_locs_dup (self ):
0 commit comments