@@ -317,26 +317,26 @@ def test_get_indexer_uint64(self, index_large):
317317 tm .assert_numpy_array_equal (indexer , expected )
318318
319319 @pytest .mark .parametrize ("val, val2" , [(4 , 5 ), (4 , 4 ), (4 , NA ), (NA , NA )])
320- def test_get_loc_masked (self , val , val2 , any_numeric_ea_dtype ):
320+ def test_get_loc_masked (self , val , val2 , any_numeric_ea_and_arrow_dtype ):
321321 # GH#39133
322- idx = Index ([1 , 2 , 3 , val , val2 ], dtype = any_numeric_ea_dtype )
322+ idx = Index ([1 , 2 , 3 , val , val2 ], dtype = any_numeric_ea_and_arrow_dtype )
323323 result = idx .get_loc (2 )
324324 assert result == 1
325325
326326 with pytest .raises (KeyError , match = "9" ):
327327 idx .get_loc (9 )
328328
329- def test_get_loc_masked_na (self , any_numeric_ea_dtype ):
329+ def test_get_loc_masked_na (self , any_numeric_ea_and_arrow_dtype ):
330330 # GH#39133
331- idx = Index ([1 , 2 , NA ], dtype = any_numeric_ea_dtype )
331+ idx = Index ([1 , 2 , NA ], dtype = any_numeric_ea_and_arrow_dtype )
332332 result = idx .get_loc (NA )
333333 assert result == 2
334334
335- idx = Index ([1 , 2 , NA , NA ], dtype = any_numeric_ea_dtype )
335+ idx = Index ([1 , 2 , NA , NA ], dtype = any_numeric_ea_and_arrow_dtype )
336336 result = idx .get_loc (NA )
337337 tm .assert_numpy_array_equal (result , np .array ([False , False , True , True ]))
338338
339- idx = Index ([1 , 2 , 3 ], dtype = any_numeric_ea_dtype )
339+ idx = Index ([1 , 2 , 3 ], dtype = any_numeric_ea_and_arrow_dtype )
340340 with pytest .raises (KeyError , match = "NA" ):
341341 idx .get_loc (NA )
342342
@@ -371,16 +371,19 @@ def test_get_loc_masked_na_and_nan(self):
371371 idx .get_loc (NA )
372372
373373 @pytest .mark .parametrize ("val" , [4 , 2 ])
374- def test_get_indexer_masked_na (self , any_numeric_ea_dtype , val ):
374+ def test_get_indexer_masked_na (self , any_numeric_ea_and_arrow_dtype , val ):
375375 # GH#39133
376- idx = Index ([1 , 2 , NA , 3 , val ], dtype = any_numeric_ea_dtype )
376+ idx = Index ([1 , 2 , NA , 3 , val ], dtype = any_numeric_ea_and_arrow_dtype )
377377 result = idx .get_indexer_for ([1 , NA , 5 ])
378378 expected = np .array ([0 , 2 , - 1 ])
379379 tm .assert_numpy_array_equal (result , expected , check_dtype = False )
380380
381- def test_get_indexer_masked_na_boolean (self ):
381+ @pytest .mark .parametrize ("dtype" , ["boolean" , "bool[pyarrow]" ])
382+ def test_get_indexer_masked_na_boolean (self , dtype ):
382383 # GH#39133
383- idx = Index ([True , False , NA ], dtype = "boolean" )
384+ if dtype == "bool[pyarrow]" :
385+ pytest .importorskip ("pyarrow" )
386+ idx = Index ([True , False , NA ], dtype = dtype )
384387 result = idx .get_loc (False )
385388 assert result == 1
386389 result = idx .get_loc (NA )
0 commit comments