mhatipog opened a new issue, #55837:
URL: https://github.com/apache/arrow/issues/55837

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `Table.to_pandas()` crashes on a run-end encoded column of time zone aware 
timestamps:
   
   ```python
   import pyarrow as pa
   import pyarrow.compute as pc
   
   ts = pa.array([0, 0, 3600, None], pa.timestamp("s", tz="Europe/Brussels"))
   pa.table({"c": pc.run_end_encode(ts)}).to_pandas()
   # Segmentation fault
   ```
   
   `ConsolidatedBlockCreator::CreateBlocks` in `arrow_to_pandas.cc` takes 
`*arrays_[i]->type()` before calling `GetBlockType`, which replaces a run-end 
encoded column with its decoded values. Writers that are created from the 
column type (time zone aware datetimes, categoricals) then get the run-end 
encoded type instead of the value type. Reading the type after `GetBlockType` 
fixes it.
   
   Dictionary values take the same path, so the `to_pandas()` part of #55489 
needs this as well.
   
   Version: pyarrow 26.0.1, pandas 3.1.1, Python 3.12, Linux aarch64.
   
   ### 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