Skip to content

Commit e1581f8

Browse files
authored
fix: assert_arrays_eq macro reexports format function to hide itertools dep (#5543)
fix: #5544 Signed-off-by: Robert Kruszewski <[email protected]>
1 parent 85fd064 commit e1581f8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

vortex-array/src/arrays/assertions.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use std::fmt::Display;
5+
6+
use itertools::Itertools;
7+
8+
pub fn format_indices<I: IntoIterator<Item = usize>>(indices: I) -> impl Display {
9+
indices.into_iter().format(",")
10+
}
11+
412
#[macro_export]
513
macro_rules! assert_arrays_eq {
614
($left:expr, $right:expr) => {{
@@ -32,7 +40,7 @@ macro_rules! assert_arrays_eq {
3240
if mismatched_indices.len() != 0 {
3341
panic!(
3442
"assertion left == right failed: arrays do not match at indices: {}.\n left: {}\n right: {}",
35-
itertools::Itertools::format(mismatched_indices.into_iter(), ", "),
43+
$crate::arrays::format_indices(mismatched_indices),
3644
left.display_values(),
3745
right.display_values()
3846
)

vortex-array/src/arrays/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#[cfg(any(test, feature = "test-harness"))]
77
mod assertions;
88

9+
#[cfg(any(test, feature = "test-harness"))]
10+
pub use assertions::format_indices;
11+
912
#[cfg(test)]
1013
mod validation_tests;
1114

0 commit comments

Comments
 (0)