You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "rok (via GitHub)" <gi...@apache.org> on 2024/08/08 09:49:34 UTC

Re: [I] FixedShapeTensorArray.to_numpy_ndarray() fails with numpy arrays of type string in Pyarrow-16, but works with v15 [arrow]

rok commented on issue #43614:
URL: https://github.com/apache/arrow/issues/43614#issuecomment-2275411380

   I wasn't aware `FixedShapeTensorArray` could be constructed with strings, are you sure your data round trips unchanged?
   
   As a workaround you could change `_extract_element_feather` to this:
   ```python
   def _extract_element_feather(column: Any):
       import pyarrow as pa
   
       if type(column) == pa.lib.FixedShapeTensorArray:
           return column.storage.to_numpy(zero_copy_only=False)
       else:
           return column.as_py()
   ```
   
   When `FixedShapeTensorArray` was built we didn't expect it'd be used for strings. However if there's need for it we can have a discussion and see if we could accommodate the usecase.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org