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

Jefffrey pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new 1daaf29541 Flip dict null_density in test utils (#7475)
1daaf29541 is described below

commit 1daaf295410a824b0612e4c7e292308fbaaf4aed
Author: Dmitrii Blaginin <[email protected]>
AuthorDate: Sat Jul 4 07:32:11 2026 +0100

    Flip dict null_density in test utils (#7475)
    
    # Rationale for this change
    
    `create_dict_from_values` has a reversed null_desity logic. For example:
    
    ```rust
    
        let arr = create_string_array_with_len::<i32>(20, 0.0, 50); // will 
generate no nulls
        let dict = create_dict_from_values::<Int32Type>(200_000, 1.0, &arr); // 
will also generate no nulls
    ```
    
    
    # Are there any user-facing changes?
    Yes
    
    ---------
    
    Co-authored-by: Jeffrey Vo <[email protected]>
---
 arrow/src/util/bench_util.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arrow/src/util/bench_util.rs b/arrow/src/util/bench_util.rs
index 01e55c12b0..d8dce50961 100644
--- a/arrow/src/util/bench_util.rs
+++ b/arrow/src/util/bench_util.rs
@@ -797,7 +797,7 @@ where
 
     let nulls: Option<Buffer> = (null_density != 0.).then(|| {
         (0..size)
-            .map(|_| rng.random_bool(null_density as _))
+            .map(|_| rng.random_bool((1.0 - null_density) as _))
             .collect()
     });
 

Reply via email to