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

Function test_count

python/pyarrow/tests/test_compute.py:3037–3047  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3035
3036
3037def test_count():
3038 arr = pa.array([1, 2, 3, None, None])
3039 assert pc.count(arr).as_py() == 3
3040 assert pc.count(arr, mode='only_valid').as_py() == 3
3041 assert pc.count(arr, mode='only_null').as_py() == 2
3042 assert pc.count(arr, mode='all').as_py() == 5
3043 assert pc.count(arr, 'all').as_py() == 5
3044
3045 with pytest.raises(ValueError,
3046 match='"something else" is not a valid count mode'):
3047 pc.count(arr, 'something else')
3048
3049
3050def test_count_run_end_encoded_nulls():

Callers

nothing calls this directly

Calls 3

as_pyMethod · 0.80
arrayMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected