amol- commented on code in PR #14369:
URL: https://github.com/apache/arrow/pull/14369#discussion_r1036976250


##########
python/pyarrow/array.pxi:
##########
@@ -2746,6 +2762,29 @@ cdef class StructArray(Array):
         result.validate()
         return result
 
+    def sort(self, order="ascending", fieldname=None):
+        """
+        Sort the StructArray
+
+        Parameters
+        ----------
+        order : "ascending" or "descending"
+            The order of the sorting.
+        fieldname : str or None, default None
+            If to sort the array by one of its fields
+            or by the whole array.
+
+        Returns
+        -------
+        result : StructArray
+        """
+        if fieldname is not None:
+            tosort = self.field(fieldname)

Review Comment:
   `field` implied a `Field` instance to me, that's why I went for `fieldname`. 



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