MCPcopy Create free account
hub / github.com/apache/arrow / test_array_invalid_mask_raises

Function test_array_invalid_mask_raises

python/pyarrow/tests/test_array.py:3885–3908  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3883
3884@pytest.mark.numpy
3885def test_array_invalid_mask_raises():
3886 # ARROW-10742
3887 cases = [
3888 ([1, 2], np.array([False, False], dtype="O"),
3889 TypeError, "must be boolean dtype"),
3890
3891 ([1, 2], np.array([[False], [False]]),
3892 pa.ArrowInvalid, "must be 1D array"),
3893
3894 ([1, 2, 3], np.array([False, False]),
3895 pa.ArrowInvalid, "different length"),
3896
3897 (np.array([1, 2]), np.array([False, False], dtype="O"),
3898 TypeError, "must be boolean dtype"),
3899
3900 (np.array([1, 2]), np.array([[False], [False]]),
3901 ValueError, "must be 1D array"),
3902
3903 (np.array([1, 2, 3]), np.array([False, False]),
3904 ValueError, "different length"),
3905 ]
3906 for obj, mask, ex, msg in cases:
3907 with pytest.raises(ex, match=msg):
3908 pa.array(obj, mask=mask)
3909
3910
3911def test_array_from_large_pyints():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected