(arrow_type)
| 410 | |
| 411 | @pytest.mark.parametrize('arrow_type', numerical_arrow_types) |
| 412 | def test_sum_chunked_array(arrow_type): |
| 413 | arr = pa.chunked_array([pa.array([1, 2, 3, 4], type=arrow_type)]) |
| 414 | assert pc.sum(arr).as_py() == 10 |
| 415 | |
| 416 | arr = pa.chunked_array([ |
| 417 | pa.array([1, 2], type=arrow_type), pa.array([3, 4], type=arrow_type) |
| 418 | ]) |
| 419 | assert pc.sum(arr).as_py() == 10 |
| 420 | |
| 421 | arr = pa.chunked_array([ |
| 422 | pa.array([1, 2], type=arrow_type), |
| 423 | pa.array([], type=arrow_type), |
| 424 | pa.array([3, 4], type=arrow_type) |
| 425 | ]) |
| 426 | assert pc.sum(arr).as_py() == 10 |
| 427 | |
| 428 | arr = pa.chunked_array((), type=arrow_type) |
| 429 | assert arr.num_chunks == 0 |
| 430 | assert pc.sum(arr).as_py() is None # noqa: E711 |
| 431 | assert pc.sum(arr, min_count=0).as_py() == 0 |
| 432 | |
| 433 | |
| 434 | @pytest.mark.parametrize('arrow_type', [pa.decimal128(3, 2), pa.decimal256(3, 2)]) |
nothing calls this directly
no test coverage detected