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

Function test_dictionary_from_boolean

python/pyarrow/tests/test_convert_builtin.py:2170–2179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2168
2169
2170def test_dictionary_from_boolean():
2171 typ = pa.dictionary(pa.int8(), value_type=pa.bool_())
2172 a = pa.array([False, False, True, False, True], type=typ)
2173 assert isinstance(a.type, pa.DictionaryType)
2174 assert a.type.equals(typ)
2175
2176 expected_indices = pa.array([0, 0, 1, 0, 1], type=pa.int8())
2177 expected_dictionary = pa.array([False, True], type=pa.bool_())
2178 assert a.indices.equals(expected_indices)
2179 assert a.dictionary.equals(expected_dictionary)
2180
2181
2182@pytest.mark.parametrize('value_type', [

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
dictionaryMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected