diff --git a/arrow-flight/Cargo.toml b/arrow-flight/Cargo.toml index 04a1a937d082..941cc2bdbd53 100644 --- a/arrow-flight/Cargo.toml +++ b/arrow-flight/Cargo.toml @@ -39,7 +39,7 @@ futures = { version = "0.3", default-features = false, features = ["alloc"]} tonic-build = "0.4" # Pin specific version of the tonic-build dependencies to avoid auto-generated # (and checked in) arrow.flight.protocol.rs from changing -proc-macro2 = "=1.0.24" +proc-macro2 = "=1.0.27" #[lib] #name = "flight" diff --git a/arrow-pyarrow-integration-testing/Cargo.toml b/arrow-pyarrow-integration-testing/Cargo.toml index 34d243591724..55bbd77c8ab0 100644 --- a/arrow-pyarrow-integration-testing/Cargo.toml +++ b/arrow-pyarrow-integration-testing/Cargo.toml @@ -31,6 +31,8 @@ name = "arrow_pyarrow_integration_testing" crate-type = ["cdylib"] [dependencies] +# ensure we get the std version of rand so arrow builds without default features +rand = { version = "0.8" } arrow = { path = "../arrow", version = "5.0.0-SNAPSHOT" } pyo3 = { version = "0.12.1", features = ["extension-module"] } diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml index 9875262c31bc..5a14f1f0fafb 100644 --- a/arrow/Cargo.toml +++ b/arrow/Cargo.toml @@ -40,7 +40,10 @@ serde = { version = "1.0", features = ["rc"] } serde_derive = "1.0" serde_json = { version = "1.0", features = ["preserve_order"] } indexmap = "1.6" -rand = "0.7" +rand = { version = "0.8", default-features = false } +# getrandom is a dependency of rand, not (directly) of arrow +# need to specify `js` feature to build on wasm +getrandom = { version = "0.2", features = ["js"] } num = "0.4" csv_crate = { version = "1.1", optional = true, package="csv" } regex = "1.3" diff --git a/arrow/benches/mutable_array.rs b/arrow/benches/mutable_array.rs index 52da38a1d543..3a42ec1be3c3 100644 --- a/arrow/benches/mutable_array.rs +++ b/arrow/benches/mutable_array.rs @@ -31,8 +31,8 @@ fn create_slices(size: usize) -> Vec<(usize, usize)> { (0..size) .map(|_| { - let start = rng.gen_range(0, size / 2); - let end = rng.gen_range(start + 1, size); + let start = rng.gen_range(0..size / 2); + let end = rng.gen_range(start + 1..size); (start, end) }) .collect() diff --git a/arrow/benches/take_kernels.rs b/arrow/benches/take_kernels.rs index b1d03d70c9a7..5de198b3f5ae 100644 --- a/arrow/benches/take_kernels.rs +++ b/arrow/benches/take_kernels.rs @@ -35,7 +35,7 @@ fn create_random_index(size: usize, null_density: f32) -> UInt32Array { if rng.gen::() < null_density { builder.append_null().unwrap() } else { - let value = rng.gen_range::(0u32, size as u32); + let value = rng.gen_range::(0u32..size as u32); builder.append_value(value).unwrap(); } } diff --git a/arrow/src/util/bench_util.rs b/arrow/src/util/bench_util.rs index fd0ece830a16..40340336882b 100644 --- a/arrow/src/util/bench_util.rs +++ b/arrow/src/util/bench_util.rs @@ -102,7 +102,8 @@ pub fn create_string_array( if rng.gen::() < null_density { None } else { - let value = rng.sample_iter(&Alphanumeric).take(4).collect::(); + let value = rng.sample_iter(&Alphanumeric).take(4).collect(); + let value = String::from_utf8(value).unwrap(); Some(value) } }) @@ -124,7 +125,7 @@ pub fn create_binary_array( } else { let value = rng .sample_iter::(Standard) - .take(range_rng.gen_range(0, 8)) + .take(range_rng.gen_range(0..8)) .collect::>(); Some(value) } diff --git a/arrow/src/util/bit_util.rs b/arrow/src/util/bit_util.rs index c11e10081243..d046f781f053 100644 --- a/arrow/src/util/bit_util.rs +++ b/arrow/src/util/bit_util.rs @@ -271,7 +271,7 @@ mod tests { let mut v = HashSet::new(); let mut rng = seedable_rng(); for _ in 0..NUM_SETS { - let offset = rng.gen_range(0, 8 * NUM_BYTES); + let offset = rng.gen_range(0..8 * NUM_BYTES); v.insert(offset); set_bit(&mut buffer[..], offset); } diff --git a/arrow/src/util/data_gen.rs b/arrow/src/util/data_gen.rs index cd1f25efea06..08624ae86ee8 100644 --- a/arrow/src/util/data_gen.rs +++ b/arrow/src/util/data_gen.rs @@ -218,7 +218,7 @@ fn create_random_offsets( offsets.push(current_offset); (0..size).for_each(|_| { - current_offset += rng.gen_range(min, max); + current_offset += rng.gen_range(min..max); offsets.push(current_offset); }); diff --git a/arrow/src/util/test_util.rs b/arrow/src/util/test_util.rs index 261b2456dc6d..4b193f774178 100644 --- a/arrow/src/util/test_util.rs +++ b/arrow/src/util/test_util.rs @@ -25,7 +25,7 @@ pub fn random_bytes(n: usize) -> Vec { let mut result = vec![]; let mut rng = seedable_rng(); for _ in 0..n { - result.push(rng.gen_range(0, 255)); + result.push(rng.gen_range(0..255)); } result } diff --git a/parquet/Cargo.toml b/parquet/Cargo.toml index d66ee237eeca..120b81d1a3f8 100644 --- a/parquet/Cargo.toml +++ b/parquet/Cargo.toml @@ -38,7 +38,7 @@ snap = { version = "1.0", optional = true } brotli = { version = "3.3", optional = true } flate2 = { version = "1.0", optional = true } lz4 = { version = "1.23", optional = true } -zstd = { version = "0.8", optional = true } +zstd = { version = "0.9", optional = true } chrono = "0.4" num-bigint = "0.4" arrow = { path = "../arrow", version = "5.0.0-SNAPSHOT", optional = true } @@ -54,7 +54,6 @@ snap = "1.0" brotli = "3.3" flate2 = "1.0" lz4 = "1.23" -zstd = "0.8" arrow = { path = "../arrow", version = "5.0.0-SNAPSHOT" } serde_json = { version = "1.0", features = ["preserve_order"] }