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

Function test_dictionary_from_integers

python/pyarrow/tests/test_convert_builtin.py:2194–2203  ·  view source on GitHub ↗
(value_type)

Source from the content-addressed store, hash-verified

2192 pa.float64(),
2193])
2194def test_dictionary_from_integers(value_type):
2195 typ = pa.dictionary(pa.int8(), value_type=value_type)
2196 a = pa.array([1, 2, 1, 1, 2, 3], type=typ)
2197 assert isinstance(a.type, pa.DictionaryType)
2198 assert a.type.equals(typ)
2199
2200 expected_indices = pa.array([0, 1, 0, 0, 1, 2], type=pa.int8())
2201 expected_dictionary = pa.array([1, 2, 3], type=value_type)
2202 assert a.indices.equals(expected_indices)
2203 assert a.dictionary.equals(expected_dictionary)
2204
2205
2206@pytest.mark.parametrize('input_index_type', [

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
dictionaryMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected