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

Function test_mode_chunked_array

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

Source from the content-addressed store, hash-verified

499
500
501def test_mode_chunked_array():
502 # ARROW-9917
503 arr = pa.chunked_array([pa.array([1, 1, 3, 4, 3, 5], type='int64')])
504 mode = pc.mode(arr)
505 assert len(mode) == 1
506 assert mode[0].as_py() == {"mode": 1, "count": 2}
507
508 mode = pc.mode(arr, n=2)
509 assert len(mode) == 2
510 assert mode[0].as_py() == {"mode": 1, "count": 2}
511 assert mode[1].as_py() == {"mode": 3, "count": 2}
512
513 arr = pa.chunked_array((), type='int64')
514 assert arr.num_chunks == 0
515 assert len(pc.mode(arr)) == 0
516
517
518def test_empty_chunked_array():

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
chunked_arrayMethod · 0.80
as_pyMethod · 0.80
arrayMethod · 0.45
modeMethod · 0.45

Tested by

no test coverage detected