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