This is an automated email from the ASF dual-hosted git repository.

richox pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/auron.git


The following commit(s) were added to refs/heads/master by this push:
     new f4823514 Improvement for deprecated API thread_rng/gen_range to 
rng/random_range (#1278)
f4823514 is described below

commit f482351420bf517a232ba59ce53fe53405036245
Author: xuzifu666 <[email protected]>
AuthorDate: Sun Sep 7 19:01:30 2025 +0800

    Improvement for deprecated API thread_rng/gen_range to rng/random_range 
(#1278)
---
 native-engine/datafusion-ext-commons/src/algorithm/loser_tree.rs | 6 +++---
 native-engine/datafusion-ext-commons/src/algorithm/rdx_queue.rs  | 6 +++---
 native-engine/datafusion-ext-commons/src/spark_bit_array.rs      | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/native-engine/datafusion-ext-commons/src/algorithm/loser_tree.rs 
b/native-engine/datafusion-ext-commons/src/algorithm/loser_tree.rs
index e8728e6c..04f865a0 100644
--- a/native-engine/datafusion-ext-commons/src/algorithm/loser_tree.rs
+++ b/native-engine/datafusion-ext-commons/src/algorithm/loser_tree.rs
@@ -149,13 +149,13 @@ mod test {
     #[test]
     fn fuzztest() {
         for _ in 0..10 {
-            let num_nodes = rand::thread_rng().gen_range(1..=999);
+            let num_nodes = rand::rng().random_range(1..=999);
             let mut nodes = vec![];
             for _ in 0..num_nodes {
-                let node_len = rand::thread_rng().gen_range(1..=999);
+                let node_len = rand::rng().random_range(1..=999);
                 let mut node = vec![];
                 for _ in 0..node_len {
-                    node.push(rand::thread_rng().gen_range(1000..=9999));
+                    node.push(rand::rng().random_range(1000..=9999));
                 }
                 nodes.push(node);
             }
diff --git a/native-engine/datafusion-ext-commons/src/algorithm/rdx_queue.rs 
b/native-engine/datafusion-ext-commons/src/algorithm/rdx_queue.rs
index 68293955..7de4dc6c 100644
--- a/native-engine/datafusion-ext-commons/src/algorithm/rdx_queue.rs
+++ b/native-engine/datafusion-ext-commons/src/algorithm/rdx_queue.rs
@@ -161,13 +161,13 @@ mod test {
     #[test]
     fn fuzztest() {
         for _ in 0..10 {
-            let num_nodes = rand::thread_rng().gen_range(1..=999);
+            let num_nodes = rand::rng().random_range(1..=999);
             let mut nodes = vec![];
             for _ in 0..num_nodes {
-                let node_len = rand::thread_rng().gen_range(1..=999);
+                let node_len = rand::rng().random_range(1..=999);
                 let mut node = vec![];
                 for _ in 0..node_len {
-                    node.push(rand::thread_rng().gen_range(1000..=9999));
+                    node.push(rand::rng().random_range(1000..=9999));
                 }
                 nodes.push(node);
             }
diff --git a/native-engine/datafusion-ext-commons/src/spark_bit_array.rs 
b/native-engine/datafusion-ext-commons/src/spark_bit_array.rs
index 8654a470..ae365720 100644
--- a/native-engine/datafusion-ext-commons/src/spark_bit_array.rs
+++ b/native-engine/datafusion-ext-commons/src/spark_bit_array.rs
@@ -147,7 +147,7 @@ mod tests {
 
         let mut bit_array = SparkBitArray::new_with_num_bits(320);
         let indexes: Vec<usize> = (1..=100)
-            .map(|_| r.gen_range(0..320) as usize)
+            .map(|_| r.random_range(0..320) as usize)
             .unique()
             .collect();
 
@@ -166,11 +166,11 @@ mod tests {
         let mut bit_array2 = SparkBitArray::new_with_num_bits(64 * 6);
 
         let indexes1: Vec<usize> = (1..=100)
-            .map(|_| r.gen_range(0..64 * 6) as usize)
+            .map(|_| r.random_range(0..64 * 6) as usize)
             .unique()
             .collect();
         let indexes2: Vec<usize> = (1..=100)
-            .map(|_| r.gen_range(0..64 * 6) as usize)
+            .map(|_| r.random_range(0..64 * 6) as usize)
             .unique()
             .collect();
 

Reply via email to