Skip to content

Commit 79c3116

Browse files
committed
Removed dtype preservation tests for take, except for boolean case.
1 parent aa1c58b commit 79c3116

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

pandas/tests/arrays/numpy_/test_numpy.py

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -355,30 +355,10 @@ def test_take_assigns_floating_point_dtype(dtype):
355355
assert result.dtype.numpy_dtype == expected
356356

357357

358-
@pytest.mark.parametrize(
359-
"dtype",
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-
],
371-
)
372-
def test_take_assigns_integer_dtype_when_fill_disallowed(dtype):
373-
# GH#62448.
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))
378-
358+
def test_take_preserves_boolean_arrays():
359+
array = NumpyExtensionArray(np.array([False, True, False], dtype=np.bool_))
379360
result = array.take([-1], allow_fill=False)
380-
381-
assert result.dtype.numpy_dtype == dtype
361+
assert result.dtype.numpy_dtype == np.bool_
382362

383363

384364
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)