jorisvandenbossche commented on a change in pull request #11659:
URL: https://github.com/apache/arrow/pull/11659#discussion_r746616404



##########
File path: python/pyarrow/array.pxi
##########
@@ -2360,6 +2360,25 @@ cdef class StructArray(Array):
         result.validate()
         return result
 
+    def sort_by(self, fieldname, order="ascending"):

Review comment:
       But it does make sense to sort just the array. 
   
   What I mean is, also for sorting an array, it takes some code:
   
   ```
   arr.take(pc.array_sort_indices(arr, order))
   ```
   
   vs for struct array:
   
   ```
   arr.take(pc.array_sort_indices(arr.field(name), order)
   ```
   
   Once you have the first snippet, I don't see why the second snippet would 
necessarily warrant a helper function (and the first not)




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