You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "danepitkin (via GitHub)" <gi...@apache.org> on 2023/06/23 17:58:01 UTC

[GitHub] [arrow] danepitkin commented on a diff in pull request #36164: GH-35573: [Python] pa.FixedShapeTensorArray.to_numpy_ndarray fails on sliced arrays

danepitkin commented on code in PR #36164:
URL: https://github.com/apache/arrow/pull/36164#discussion_r1240120921


##########
python/pyarrow/array.pxi:
##########
@@ -3153,7 +3153,7 @@ class FixedShapeTensorArray(ExtensionArray):
         Note: ``permutation`` should be trivial (``None`` or ``[0, 1, ..., len(shape)-1]``).
         """
         if self.type.permutation is None or self.type.permutation == list(range(len(self.type.shape))):
-            np_flat = np.asarray(self.storage.values)
+            np_flat = np.asarray(self.storage.flatten())

Review Comment:
   I'm curious, is the underlying `Array` object guaranteed to be chunked and have a `flatten()` API? I tried digging through the code a bit, but had trouble finding the answer.



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