Skip to content

re-export arrow::util rand version, breaking downstreams on a different rand major #10685

Closed

Description

@alamb

Is your feature request related to a problem or challenge?

While updating DataFusion to arrow 60 I found that the rand 0.10 upgrade in #10566 breaks downstream users of arrow::util::bench_util and arrow::util::test_util that are on a different rand major. These APIs expose arrow's rand version in their signatures:

  • bench_util::create_primitive_array has a StandardUniform: Distribution<T::Native> bound, which callers must restate in their own generic code — but they can only name their rand's StandardUniform
  • test_util::seedable_rng returns arrow's rand's StdRng

DataFusion is stuck on rand 0.9 for now (rand_distr 0.5 has no rand-0.10-compatible release), so generic bench helpers like this no longer compile:

use rand::distr::{Distribution, StandardUniform}; // rand 0.9

pub fn create_list_array<T>(size: usize, null_density: f32) -> ListArray
where
    T: ArrowPrimitiveType,
    StandardUniform: Distribution<T::Native>, // rand 0.9 bound: cannot satisfy
                                              // create_primitive_array's rand 0.10 bound
{
    let values = create_primitive_array::<T>(length, 0.0);
    // ...
}

We had to remove the generic bound (pinning T::Native = i64) and replace seedable_rng with a local copy:

/// Returns a fixed-seed RNG using this crate's `rand` version (arrow's
/// `test_util::seedable_rng` returns its own `rand` version's `StdRng`)
fn seedable_rng() -> StdRng {
    StdRng::seed_from_u64(42)
}

Describe the solution you'd like

Re-export arrow's rand (e.g. pub use rand; from arrow::util under the relevant feature) so downstreams can name the right StandardUniform/StdRng types when calling these APIs, regardless of which rand they depend on themselves.

Describe alternatives you've considered

Downstreams can avoid the generic bounds and copy seedable_rng locally, as shown above.

At a minimum, call this out in the arrow 60 release notes / upgrade guide, since the breakage only shows up in downstream test and bench code.

Additional context

Activity

  1. changed the title [-]`arrow::util` test/bench APIs leak the `rand` version, breaking downstreams on a different rand major[/-] [+]re-export `arrow::util` `rand` version, breaking downstreams on a different rand major[/+] on Aug 14, 2026
  2. added a commit that references this issue on Aug 14, 2026
    d004764
  3. added a commit that references this issue on Aug 15, 2026
    9a5d9e9
  4. added a commit that references this issue on Aug 19, 2026
    efc375a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions