Skip to content

Commit 740e1ef

Browse files
committed
test(scan): fix V2 chunk test lint and formatting
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent e39866a commit 740e1ef

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎vortex-layout/src/scan/v2/tests.rs‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ use vortex_io::session::RuntimeSessionExt;
3737
use vortex_scan::strict_sorted_buffer::StrictSortedBuffer;
3838
use vortex_session::VortexSession;
3939

40-
use super::PreparedScan;
4140
use super::MAX_ROWS_PER_CHUNK;
41+
use super::PreparedScan;
4242
use super::ScanBuilder;
4343
use super::ScanFile;
4444
use super::row_chunks;
@@ -371,7 +371,8 @@ async fn dictionary_values_are_reused_between_splits() -> VortexResult<()> {
371371
.write_stream(
372372
ArrayContext::empty().into(),
373373
Arc::<TestSegments>::clone(&segments),
374-
SequentialStreamAdapter::new(dtype, stream::iter(arrays.into_iter().map(Ok))).sendable(),
374+
SequentialStreamAdapter::new(dtype, stream::iter(arrays.into_iter().map(Ok)))
375+
.sendable(),
375376
eof,
376377
&session,
377378
)
@@ -394,18 +395,18 @@ async fn dictionary_values_are_reused_between_splits() -> VortexResult<()> {
394395
let before = counted.reads.load(Ordering::Relaxed);
395396
let arrays = split.run(Arc::clone(&scan.io)).await?;
396397
let reads = counted.reads.load(Ordering::Relaxed) - before;
397-
let code_chunks = (rows.end - 1) / STORED_CHUNK_ROWS as u64
398-
- rows.start / STORED_CHUNK_ROWS as u64
399-
+ 1;
398+
let code_chunks =
399+
(rows.end - 1) / STORED_CHUNK_ROWS as u64 - rows.start / STORED_CHUNK_ROWS as u64 + 1;
400400
assert_eq!(
401401
reads,
402402
if index == 0 {
403403
STORED_CHUNKS
404404
} else {
405-
code_chunks as usize
405+
usize::try_from(code_chunks)?
406406
}
407407
);
408-
let expected = PrimitiveArray::from_iter(i32::try_from(rows.start)?..i32::try_from(rows.end)?);
408+
let expected =
409+
PrimitiveArray::from_iter(i32::try_from(rows.start)?..i32::try_from(rows.end)?);
409410
assert_arrays_eq!(
410411
ChunkedArray::try_new(arrays, layout.dtype().clone())?.into_array(),
411412
expected,

0 commit comments

Comments
 (0)