Skip to content

Commit 203fcd6

Browse files
committed
chore(spatial): fix clippy and fmt lints
Signed-off-by: Robert Kruszewski <[email protected]>
1 parent aaea379 commit 203fcd6

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

‎vortex-layout/src/layouts/zoned/writer.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ mod tests {
481481

482482
#[test]
483483
fn default_aggregates_bound_variable_length_min_max() {
484-
let aggregate_fns =
485-
default_zoned_aggregate_fns(&DType::Utf8(Nullability::NonNullable));
484+
let aggregate_fns = default_zoned_aggregate_fns(&DType::Utf8(Nullability::NonNullable));
486485

487486
assert_eq!(
488487
aggregate_fns[0].as_::<BoundedMax>().max_bytes,

‎vortex-spatial/src/aggregate_fn/aabb.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ mod tests {
263263
use vortex_array::aggregate_fn::DynAccumulator;
264264
use vortex_array::aggregate_fn::EmptyOptions;
265265
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
266-
use vortex_array::dtype::Nullability;
267266
use vortex_array::scalar::Scalar;
268267
use vortex_error::VortexResult;
269268
use vortex_session::VortexSession;

‎vortex-spatial/src/tests/statistics.rs‎

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ fn zone_bounds_are_opt_in(
106106
FlatLayoutStrategy::default(),
107107
ZonedLayoutOptions {
108108
block_size: NonZeroUsize::new(2).vortex_expect("non-zero zone size"),
109-
aggregate_fns: record_bounds.then(|| Arc::from([GeometryAabb.bind(EmptyOptions)])),
109+
aggregate_fns: record_bounds
110+
.then(|| Arc::from([GeometryAabb.bind(EmptyOptions)])),
110111
..Default::default()
111112
},
112113
),
@@ -124,7 +125,9 @@ fn zone_bounds_are_opt_in(
124125
.with_file_statistics(vec![])
125126
.write(&mut buffer, array.to_array_stream())
126127
.await?;
127-
let file = session.open_options().open_buffer(ByteBuffer::from(buffer))?;
128+
let file = session
129+
.open_options()
130+
.open_buffer(ByteBuffer::from(buffer))?;
128131
assert!(file.file_stats().is_none());
129132
let zones = file
130133
.footer()
@@ -168,7 +171,8 @@ fn explicit_file_bounds_span_batches(
168171
geometry_batch(vec![Some((-10.0, 80.0)), Some((30.0, 40.0))], nested)?,
169172
];
170173
let dtype = batches[0].dtype().clone();
171-
let stream = ArrayIteratorAdapter::new(dtype, batches.into_iter().map(Ok)).into_array_stream();
174+
let stream =
175+
ArrayIteratorAdapter::new(dtype, batches.into_iter().map(Ok)).into_array_stream();
172176
let mut options = session
173177
.write_options()
174178
.include_nested_statistics()
@@ -183,7 +187,9 @@ fn explicit_file_bounds_span_batches(
183187
}
184188
let mut buffer = ByteBufferMut::empty();
185189
let summary = options.write(&mut buffer, stream).await?;
186-
let file = session.open_options().open_buffer(ByteBuffer::from(buffer))?;
190+
let file = session
191+
.open_options()
192+
.open_buffer(ByteBuffer::from(buffer))?;
187193
let path = if nested {
188194
FieldPath::from_name("location").push("geom")
189195
} else {
@@ -237,7 +243,9 @@ fn file_bounds_enable_spatial_pruning(
237243
})
238244
.write(&mut buffer, batch.to_array_stream())
239245
.await?;
240-
let file = session.open_options().open_buffer(ByteBuffer::from(buffer))?;
246+
let file = session
247+
.open_options()
248+
.open_buffer(ByteBuffer::from(buffer))?;
241249
let column = get_item(
242250
"geom",
243251
if nested {
@@ -285,7 +293,9 @@ fn file_bounds_enable_spatial_pruning(
285293
}
286294

287295
#[rstest]
288-
fn file_statistics_without_geometry_bounds(#[values(false, true)] disabled: bool) -> VortexResult<()> {
296+
fn file_statistics_without_geometry_bounds(
297+
#[values(false, true)] disabled: bool,
298+
) -> VortexResult<()> {
289299
block_on(|handle| async move {
290300
let session = file_session(handle)?;
291301
crate::initialize(&session);
@@ -302,7 +312,9 @@ fn file_statistics_without_geometry_bounds(#[values(false, true)] disabled: bool
302312
.with_file_statistics(requested)
303313
.write(&mut buffer, batch.to_array_stream())
304314
.await?;
305-
let file = session.open_options().open_buffer(ByteBuffer::from(buffer))?;
315+
let file = session
316+
.open_options()
317+
.open_buffer(ByteBuffer::from(buffer))?;
306318
if disabled {
307319
assert!(file.file_stats().is_none());
308320
} else {
@@ -336,7 +348,9 @@ fn default_file_statistics_do_not_record_geometry_bounds(
336348
options
337349
};
338350
let summary = options.write(&mut buffer, batch.to_array_stream()).await?;
339-
let file = session.open_options().open_buffer(ByteBuffer::from(buffer))?;
351+
let file = session
352+
.open_options()
353+
.open_buffer(ByteBuffer::from(buffer))?;
340354
for stats in [summary.footer().statistics(), file.file_stats()] {
341355
let (stats, _) = stats
342356
.and_then(|stats| stats.get_by_path(&FieldPath::from_name("geom")))
@@ -375,7 +389,9 @@ fn spatial_initialization_preserves_ordinary_file_statistics(
375389
options
376390
};
377391
options.write(&mut buffer, batch.to_array_stream()).await?;
378-
let file = session.open_options().open_buffer(ByteBuffer::from(buffer))?;
392+
let file = session
393+
.open_options()
394+
.open_buffer(ByteBuffer::from(buffer))?;
379395
statistics.push(
380396
file.file_stats()
381397
.ok_or_else(|| vortex_err!("missing file statistics"))?

0 commit comments

Comments
 (0)