andygrove commented on a change in pull request #7193:
URL: https://github.com/apache/arrow/pull/7193#discussion_r425980474



##########
File path: rust/arrow/src/compute/kernels/sort.rs
##########
@@ -149,9 +151,9 @@ where
         .collect::<Vec<(u32, T::Native)>>();
     let mut nulls = null_indices;
     if !options.descending {
-        valids.sort_by_key(|a| a.1);
+        valids.sort_by(|a, b| a.1.partial_cmp(&b.1).unwrap());

Review comment:
       Won't this panic if the vector contains any `NaN` values? partial_cmp 
would return `None` in that case.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to