You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Andrei Nesterov (Jira)" <ji...@apache.org> on 2021/06/16 22:52:00 UTC

[jira] [Created] (ARROW-13102) [Python] Casting between dictionary types

Andrei Nesterov created ARROW-13102:
---------------------------------------

             Summary: [Python] Casting between dictionary types
                 Key: ARROW-13102
                 URL: https://issues.apache.org/jira/browse/ARROW-13102
             Project: Apache Arrow
          Issue Type: Improvement
            Reporter: Andrei Nesterov


Casting between dictionary types isn't implemented. It leads to boilerplate code.
 
{code:python}
import pyarrow as pa

dt = pa.array([b"foo", b"bar", b"baz", b"bar", b"baz", b"bar"], type=pa.binary())
dictionary = dt.dictionary_encode()
print(dictionary.type)
# dictionary<values=binary, indices=int32, ordered=0>
pc.cast(dictionary, pa.dictionary(index_type=pa.int8(), value_type=pa.binary()), safe=False)
{code}


{code:java}
pyarrow.lib.ArrowNotImplementedError: Unsupported cast from dictionary<values=binary, indices=int32, ordered=0> to dictionary using function cast_dictionary
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)