0x26res opened a new issue, #33971:
URL: https://github.com/apache/arrow/issues/33971

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Using `pyarrow.Table.nbytes` on an empty table with a dictionary field 
causes a segmentation fault.
   
   ```python
   import pyarrow as pa
   
   schema = pa.schema(
       [
           pa.field("foo", pa.dictionary(pa.int32(), pa.string())),
       ]
   )
   table = pa.table({"foo": []}, schema=schema)
   
   print(table.nbytes)  # segmentation fault  python
   ```
   
   A few notes:
   - `get_total_buffer_size` works (which is a good workaround for now)
   - It works if the table has got one or more row (including nulls)
   - It works if the table is empty but there are not dictionary fields
   - I'm using `pyarrow==11.0.0` and Python 3.9.16 (but it is happening in 
`10.0.1` as well, so not a new bug)
   
   
   
   ### Component(s)
   
   Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to