jorisvandenbossche commented on code in PR #14781:
URL: https://github.com/apache/arrow/pull/14781#discussion_r1037873759
##########
python/pyarrow/array.pxi:
##########
@@ -2743,6 +2766,36 @@ cdef class StructArray(Array):
result.validate()
return result
+ def sort(self, order="ascending", fieldname=None, **options):
+ """
+ Sort the StructArray
+
+ Parameters
+ ----------
+ order : str, default "ascending"
+ Which order to sort values in.
+ Accepted values are "ascending", "descending".
+ fieldname : str or None, default None
Review Comment:
>> We currently don't use "fieldname" anywhere. Maybe just `field` as the
keyword argument?
>
> `field` implied a `Field` instance to me, that's why I went for
`fieldname`.
Good point. Another suggestion, maybe something like `by=` ?
(I suppose that in the future we might want to allow sorting by multiple
fields?)
--
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]