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

Function test_mode_chunked_array

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

Source from the content-addressed store, hash-verified

504
505
506def test_mode_chunked_array():
507 # ARROW-9917
508 arr = pa.chunked_array([pa.array([1, 1, 3, 4, 3, 5], type='int64')])
509 mode = pc.mode(arr)
510 assert len(mode) == 1
511 assert mode[0].as_py() == {"mode": 1, "count": 2}
512
513 mode = pc.mode(arr, n=2)
514 assert len(mode) == 2
515 assert mode[0].as_py() == {"mode": 1, "count": 2}
516 assert mode[1].as_py() == {"mode": 3, "count": 2}
517
518 arr = pa.chunked_array((), type='int64')
519 assert arr.num_chunks == 0
520 assert len(pc.mode(arr)) == 0
521
522
523def 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