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

Function test_take_dictionary

python/pyarrow/tests/test_compute.py:1546–1553  ·  view source on GitHub ↗
(ordered)

Source from the content-addressed store, hash-verified

1544
1545@pytest.mark.parametrize('ordered', [False, True])
1546def test_take_dictionary(ordered):
1547 arr = pa.DictionaryArray.from_arrays([0, 1, 2, 0, 1, 2], ['a', 'b', 'c'],
1548 ordered=ordered)
1549 result = arr.take(pa.array([0, 1, 3]))
1550 result.validate()
1551 assert result.to_pylist() == ['a', 'b', 'a']
1552 assert result.dictionary.to_pylist() == ['a', 'b', 'c']
1553 assert result.type.ordered is ordered
1554
1555
1556def test_take_null_type():

Callers

nothing calls this directly

Calls 3

takeMethod · 0.45
arrayMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected