()
| 3035 | |
| 3036 | |
| 3037 | def 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 | |
| 3050 | def test_count_run_end_encoded_nulls(): |