@@ -325,31 +325,56 @@ def test_factorize_unsigned():
325325 tm .assert_extension_array_equal (res_unique , NumpyExtensionArray (exp_unique ))
326326
327327
328- # TODO: Add the smaller width dtypes to the parameter sets of these tests.
329328@pytest .mark .parametrize (
330329 "dtype" ,
331- [np .uint8 , np .uint16 , np .uint32 , np .uint64 , np .int8 , np .int16 , np .int32 , np .int64 ],
330+ [
331+ np .bool ,
332+ np .uint8 ,
333+ np .uint16 ,
334+ np .uint32 ,
335+ np .uint64 ,
336+ np .int8 ,
337+ np .int16 ,
338+ np .int32 ,
339+ np .int64 ,
340+ ],
332341)
333342def test_take_assigns_floating_point_dtype (dtype ):
334343 # GH#62448.
335- array = NumpyExtensionArray (np .array ([1 , 2 , 3 ], dtype = dtype ))
344+ if dtype == np .bool :
345+ array = NumpyExtensionArray (np .array ([False , True , False ], dtype = dtype ))
346+ expected = np .dtype (object )
347+ else :
348+ array = NumpyExtensionArray (np .array ([1 , 2 , 3 ], dtype = dtype ))
349+ expected = np .float64
336350
337351 result = array .take ([- 1 ], allow_fill = True )
338-
339- assert result .dtype .numpy_dtype == np .float64
352+ assert result .dtype .numpy_dtype == expected
340353
341354 result = array .take ([- 1 ], allow_fill = True , fill_value = 5.0 )
342-
343- assert result .dtype .numpy_dtype == np .float64
355+ assert result .dtype .numpy_dtype == expected
344356
345357
346358@pytest .mark .parametrize (
347359 "dtype" ,
348- [np .uint8 , np .uint16 , np .uint32 , np .uint64 , np .int8 , np .int16 , np .int32 , np .int64 ],
360+ [
361+ np .bool ,
362+ np .uint8 ,
363+ np .uint16 ,
364+ np .uint32 ,
365+ np .uint64 ,
366+ np .int8 ,
367+ np .int16 ,
368+ np .int32 ,
369+ np .int64 ,
370+ ],
349371)
350372def test_take_assigns_integer_dtype_when_fill_disallowed (dtype ):
351373 # GH#62448.
352- array = NumpyExtensionArray (np .array ([1 , 2 , 3 ], dtype = dtype ))
374+ if dtype == np .bool :
375+ array = NumpyExtensionArray (np .array ([False , True , False ], dtype = dtype ))
376+ else :
377+ array = NumpyExtensionArray (np .array ([1 , 2 , 3 ], dtype = dtype ))
353378
354379 result = array .take ([- 1 ], allow_fill = False )
355380
0 commit comments