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

Function test_dictionary_decode

python/pyarrow/tests/test_array.py:2250–2267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2248
2249
2250def test_dictionary_decode():
2251 cases = [
2252 (pa.array([1, 2, 3, None, 1, 2, 3]),
2253 pa.DictionaryArray.from_arrays(
2254 pa.array([0, 1, 2, None, 0, 1, 2], type='int32'),
2255 [1, 2, 3])),
2256 (pa.array(['foo', None, 'bar', 'foo']),
2257 pa.DictionaryArray.from_arrays(
2258 pa.array([0, None, 1, 0], type='int32'),
2259 ['foo', 'bar'])),
2260 (pa.array(['foo', None, 'bar', 'foo'], type=pa.large_binary()),
2261 pa.DictionaryArray.from_arrays(
2262 pa.array([0, None, 1, 0], type='int32'),
2263 pa.array(['foo', 'bar'], type=pa.large_binary()))),
2264 ]
2265 for expected, arr in cases:
2266 result = arr.dictionary_decode()
2267 assert result.equals(expected)
2268
2269
2270@pytest.mark.numpy

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected