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

   ### Describe the enhancement requested
   
   I would like to have a function that allows me to get a copy of a type 
matching `pyarrow.types.is_list`, and only change the `value_type`. 
   
   So for example:
   ```
   my_list = pa.list_(pa.int32())
   my_list_int64 = my_list.with_value_type(pa.int64())
   
   my_fixed_list = pa.list_(pa.int32(), 10)
   my_list_int64 = my_list.with_value_type(pa.int64())
   
   ```
   
   For context, I'm trying to recursively cast some primary types (eg: int32 to 
int64) in a deeply nested schema.
   
   For that I have to go through a schema recursively and I use 
`pa.types.is_list` to find out a field is a list.
   But that field could be a FixedSizeList, a LargetList, so I would have to 
manage many different casts. 
   Not to mention element nullability. 
   
   I think it would make sense to do it for other nested types like map, where 
we could change the key and the value types, leaving everything else unchanged.
   
   ### 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