randolf-scholz commented on issue #34890:
URL: https://github.com/apache/arrow/issues/34890#issuecomment-1531458999

   One case when this bug appears in the wild is when trying to pivot a 
`pandas.DataFrame` that has been loaded with the `pyarrow` backend:
   
   ```python
   import pandas as pd
   
   df = (
       pd.DataFrame([("A", 1), ("B", 2), ("C", 3)], columns=["var", "val"])
       .astype({"var": "string", "val": "float32"})
       .astype({"var": "category", "val": "float32"})
   )
   
   # write and reload as parquet with pyarrow backend
   df.to_parquet("demo.parquet")
   df = pd.read_parquet("demo.parquet", dtype_backend="pyarrow")
   print(df.dtypes)  # var is now dictionary[int32,string]
   
   df.pivot(columns=["var"], values=["val"])  # ✘ ArrowNotImplementedError
   ```
   
   
   
   
   
   


-- 
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