Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-13102

[Python] Casting between dictionary types

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      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
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              manifest Andrei Nesterov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: