pitrou commented on code in PR #45392:
URL: https://github.com/apache/arrow/pull/45392#discussion_r1935602408
##########
python/pyarrow/_compute.pyx:
##########
@@ -2370,6 +2370,47 @@ class RankOptions(_RankOptions):
self._set_options(sort_keys, null_placement, tiebreaker)
+cdef class _RankQuantileOptions(FunctionOptions):
+
+ def _set_options(self, sort_keys, null_placement):
+ cdef vector[CSortKey] c_sort_keys
+ if isinstance(sort_keys, str):
+ c_sort_keys.push_back(
+ CSortKey(_ensure_field_ref(""), unwrap_sort_order(sort_keys))
+ )
+ else:
+ for name, order in sort_keys:
+ c_sort_keys.push_back(
+ CSortKey(_ensure_field_ref(name), unwrap_sort_order(order))
+ )
Review Comment:
We probably have multiple instances of such code now (to unpack
`sort_keys`), so perhaps it's worth defining a helper for it?
--
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]