Skip to content

[Python] Casting between dictionary types #28807

@asfimport

Description

@asfimport

Casting between dictionary types isn't implemented. It leads to boilerplate code.
 

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)
pyarrow.lib.ArrowNotImplementedError: Unsupported cast from dictionary<values=binary, indices=int32, ordered=0> to dictionary using function cast_dictionary

Reporter: Andrei Nesterov

Related issues:

Note: This issue was originally created as ARROW-13102. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions