dlovell opened a new issue, #541:
URL: https://github.com/apache/arrow-datafusion-python/issues/541

   **Describe the bug**
   calling `to_*` on a dataframe with a `struct` column fails unless all the 
struct fields are of type `string`
   
   **To Reproduce**
   Steps to reproduce the behavior:
   ```
   import pandas as pd
   from datafusion import (
       column,
       functions as f,
       SessionContext,
   )
   
   
   def make_df(n=30):
       return pd.DataFrame(
           {
               "a": pd.date_range(start="2020-01-01", freq="M", periods=n),
               "b": range(n),
               "c": pd.Series(range(n)).add(0.1),
               "d": pd.Series(range(n)).astype(str),
           }
       )
       # ).astype(str)
       # if all struct fields are str type, the failure does not occur
   
   
   ctx = SessionContext()
   t = ctx.from_pandas(make_df(), "t").select(
       column("a"),
       f.functions.struct(column("b"), column("c"), column("d")).alias("bcd"),
   )
   # this fails, as do all invocations of to_* methods
   t.to_pandas()
   ```
   
   **Expected behavior**
   I would expect no failure to occur, as is the case if you first cast all the 
data to type `str`


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