alamb commented on code in PR #10566:
URL: https://github.com/apache/arrow-rs/pull/10566#discussion_r3729122973
##########
arrow/Cargo.toml:
##########
@@ -54,8 +54,8 @@ arrow-schema = { workspace = true }
arrow-select = { workspace = true }
arrow-string = { workspace = true }
-rand = { version = "0.9", default-features = false, features = ["std",
"std_rng", "thread_rng"], optional = true }
-half = { version = "2.1", default-features = false, features = ["rand_distr"],
optional = true }
+rand = { version = "0.10", default-features = false, features = ["std",
"std_rng", "thread_rng"], optional = true }
Review Comment:
🎉
##########
arrow/src/util/bench_util.rs:
##########
@@ -53,6 +60,22 @@ where
.collect()
}
+/// Same as [`create_primitive_array`] but specialized for f16 since it doesn't
+/// implement the required rand traits.
+pub fn create_nullable_f16_array(size: usize, null_density: f32) ->
Float16Array {
Review Comment:
> the only other way i think is to depend on our own random trait, something
like this that codex suggested:
I would prefer to avoid introducing some new trait just for this usecase --
a free function is ok I think, especially as it seems this is something they
may fix upstream in half
##########
arrow/src/util/bench_util.rs:
##########
@@ -53,6 +60,22 @@ where
.collect()
}
+/// Same as [`create_primitive_array`] but specialized for f16 since it doesn't
+/// implement the required rand traits.
+pub fn create_nullable_f16_array(size: usize, null_density: f32) ->
Float16Array {
Review Comment:
Yeah, this is another reason I am not super psyched about using `half` for
f16 -- it also seems like half may not be maintained much anymore
##########
Cargo.lock:
##########
@@ -2917,16 +2915,6 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
-[[package]]
-name = "rand_distr"
Review Comment:
🤔 seems like we still have some older versions of rand in other
dependencies.
##########
arrow/src/util/bench_util.rs:
##########
@@ -53,6 +60,22 @@ where
.collect()
}
+/// Same as [`create_primitive_array`] but specialized for f16 since it doesn't
+/// implement the required rand traits.
+pub fn create_nullable_f16_array(size: usize, null_density: f32) ->
Float16Array {
Review Comment:
Maybe we can leave a comment saying a new version of half may also provide a
compatible implementation and we can go back to using their implementation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]