jorisvandenbossche commented on code in PR #41495:
URL: https://github.com/apache/arrow/pull/41495#discussion_r1592102009
##########
python/pyarrow/array.pxi:
##########
@@ -3925,7 +3925,8 @@ cdef class StructArray(Array):
tosort = self
indices = _pc().sort_indices(
tosort,
- options=_pc().SortOptions(sort_keys=[("", order)], **kwargs)
+ options=_pc().SortOptions(
+ sort_keys=[(field.name, order) for field in self.type],
**kwargs)
Review Comment:
We should probably define this `sort_keys` also in the `if`/`else` clause
above, so we can keep the `sort_keys=[("", order)]` for the case `by` was
specified.
This doesn't cause any issue right now, but that feels safer if we would be
stricter in the future in `sort_indices` for a flat array, that we would be
sorting it by multiple keys.
--
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]