You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "AlenkaF (via GitHub)" <gi...@apache.org> on 2023/05/15 05:43:52 UTC

[GitHub] [arrow] AlenkaF commented on issue #35573: [Python]`pa.FixedShapeTensorArray.to_numpy_ndarray` fails on sliced arrays

AlenkaF commented on issue #35573:
URL: https://github.com/apache/arrow/issues/35573#issuecomment-1547224289

   Thank you for reporting the issue!
   You are correct. It seems `.storage` holds the correct sliced part of the array and `.storage.values` does not:
   
   ```python
   (Pdb) len(pa_arr.storage.values)
   1200
   (Pdb) len(pa_arr.storage)
   100
   ```
   
   So this looks like a bug in `pyarrow.FixedSizeListArray.values`:
   
   ```python
   >>> import pyarrow as pa
   >>> arr = pa.array([[1, 2, 3], [], None, [4]], type=pa.list_(pa.int32()))
   >>> arr.values
   <pyarrow.lib.Int32Array object at 0x128665f60>
   [
     1,
     2,
     3,
     4
   ]
   >>> arr[:2].values
   <pyarrow.lib.Int32Array object at 0x1286661a0>
   [
     1,
     2,
     3,
     4
   ]
   ```
   
   I think this issue https://github.com/apache/arrow/issues/35360 has the same underlying problem.


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