Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publically re-export rand with test_utils #7128

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions arrow/src/util/bench_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@

use crate::array::*;
use crate::datatypes::*;
use crate::util::test_util::seedable_rng;
use arrow_buffer::{Buffer, IntervalMonthDayNano};
use half::f16;
use rand::distr::uniform::SampleUniform;
use rand::rng;
use rand::Rng;
use rand::SeedableRng;
use rand::{
use crate::util::rand::distr::uniform::SampleUniform;
use crate::util::rand::rng;
use crate::util::rand::Rng;
use crate::util::rand::SeedableRng;
use crate::util::rand::{
distr::{Alphanumeric, Distribution, StandardUniform},
prelude::StdRng,
};
use crate::util::test_util::seedable_rng;
use arrow_buffer::{Buffer, IntervalMonthDayNano};
use half::f16;
use std::ops::Range;

/// Creates an random (but fixed-seeded) array of a given size and null density
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/util/data_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use std::sync::Arc;

use rand::{
use crate::util::rand::{
distr::uniform::{SampleRange, SampleUniform},
Rng,
};
Expand Down
3 changes: 3 additions & 0 deletions arrow/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ pub use arrow_cast::pretty;
pub mod string_writer;
#[cfg(any(test, feature = "test_utils"))]
pub mod test_util;
/// Public re-export rand crate as it appears in the public API
#[cfg(any(test, feature = "test_utils"))]
pub use rand;

pub use arrow_cast::display;
2 changes: 1 addition & 1 deletion arrow/src/util/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//! Utils to make testing easier

use rand::{rngs::StdRng, Rng, SeedableRng};
use crate::util::rand::{rngs::StdRng, Rng, SeedableRng};
use std::{env, error::Error, fs, io::Write, path::PathBuf};

/// Returns a vector of size `n`, filled with randomly generated bytes.
Expand Down
Loading