Benedict Hutchings created ARROW-9143:
-----------------------------------------

             Summary: [Python] Segfault in dictionary_encode after 
RecordBatch.slice
                 Key: ARROW-9143
                 URL: https://issues.apache.org/jira/browse/ARROW-9143
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
    Affects Versions: 0.17.1
         Environment: linux, pyarrow 0.17.1 installed with pipenv
            Reporter: Benedict Hutchings


A segfault is triggered by calling dictionary_encode on a column after slicing 
a Recordbatch:
{code:java}
import pyarrow as pa
print(pa.__version__)

array = pa.array(['foo', 'bar', 'baz'])
batch = pa.RecordBatch.from_arrays([array], names=['a'])

batch.column(0).dictionary_encode() ### works fine

sub_array = batch.slice(1)
sub_array.column(0).dictionary_encode() ### segfault
{code}
Slicing the underlying array and dictionary_encoding works as expected:
{code:java}
array.slice(1).dictionary_encode()
{code}



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

Reply via email to