Skip to content

Commit 973e8ca

Browse files
committed
Clippy deny absolute_paths longer than 3 elements
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 3000bc0 commit 973e8ca

55 files changed

Lines changed: 161 additions & 85 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ unexpected_cfgs = { level = "deny", check-cfg = [
326326
warnings = "warn"
327327

328328
[workspace.lints.clippy]
329+
absolute_paths = "deny"
329330
all = { level = "deny", priority = -1 }
330331
as_ptr_cast_mut = "deny"
331332
borrow_as_ptr = "deny"

benchmarks/datafusion-bench/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use clap::Parser;
99
use clap::value_parser;
1010
use custom_labels::asynchronous::Label;
1111
use datafusion::arrow::array::RecordBatch;
12+
use datafusion::arrow::util::pretty::pretty_format_batches;
1213
use datafusion::common::runtime::set_join_set_tracer;
1314
use datafusion::datasource::listing::ListingOptions;
1415
use datafusion::datasource::listing::ListingTable;
@@ -26,6 +27,7 @@ use datafusion_physical_plan::collect;
2627
use futures::StreamExt;
2728
use parking_lot::Mutex;
2829
use tokio::fs::File;
30+
use vortex::io::filesystem::FileSystemRef;
2931
use vortex::scan::DataSourceRef;
3032
use vortex_bench::Benchmark;
3133
use vortex_bench::BenchmarkArg;
@@ -318,7 +320,7 @@ async fn register_v2_tables<B: Benchmark + ?Sized>(
318320
.runtime_env()
319321
.object_store(table_url.object_store())?;
320322

321-
let fs: vortex::io::filesystem::FileSystemRef = Arc::new(ObjectStoreFileSystem::new(
323+
let fs: FileSystemRef = Arc::new(ObjectStoreFileSystem::new(
322324
Arc::clone(&store),
323325
SESSION.handle(),
324326
));
@@ -411,7 +413,7 @@ impl BenchmarkQueryResult for DataFusionQueryResult {
411413
}
412414

413415
fn display(self) -> String {
414-
datafusion::arrow::util::pretty::pretty_format_batches(&self.0)
416+
pretty_format_batches(&self.0)
415417
.map(|d| d.to_string())
416418
.unwrap_or_else(|e| format!("<error: {e}>"))
417419
}

benchmarks/lance-bench/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use clap::value_parser;
1010
use lance::datafusion::LanceTableProvider;
1111
use lance::dataset::Dataset;
1212
use lance::deps::arrow_array::RecordBatch;
13+
use lance::deps::datafusion::arrow::util::pretty::pretty_format_batches;
1314
use lance::deps::datafusion::physical_plan::ExecutionPlan;
1415
use lance::deps::datafusion::prelude::SessionContext;
1516
use lance_bench::convert::convert_parquet_to_lance;
@@ -175,7 +176,7 @@ impl BenchmarkQueryResult for LanceQueryResult {
175176

176177
fn display(self) -> String {
177178
// Lance uses the same Arrow RecordBatch type
178-
lance::deps::datafusion::arrow::util::pretty::pretty_format_batches(&self.0)
179+
pretty_format_batches(&self.0)
179180
.map(|d| d.to_string())
180181
.unwrap_or_else(|e| format!("<error: {e}>"))
181182
}

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ allow-dbg-in-tests = true
22
allow-expect-in-tests = true
33
allow-unwrap-in-tests = true
44
allow-panic-in-tests = true
5+
absolute-paths-max-segments = 3
56
single-char-binding-names-threshold = 2
67
disallowed-types = [
78
{ path = "std::collections::HashMap", reason = "Use the HashMap in vortex_utils::aliases for better performance" },

encodings/alp/src/alp/compress.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ where
131131

132132
#[cfg(test)]
133133
mod tests {
134+
use core::f32;
134135
use core::f64;
135136

136137
use f64::consts::E;
@@ -598,8 +599,8 @@ mod tests {
598599
fn test_large_f32_array_with_patches() {
599600
let size = 5_000;
600601
let mut values = vec![1.5f32; size];
601-
values[100] = std::f32::consts::PI;
602-
values[1500] = std::f32::consts::E;
602+
values[100] = f32::consts::PI;
603+
values[1500] = f32::consts::E;
603604
values[3000] = f32::NEG_INFINITY;
604605
values[4500] = f32::INFINITY;
605606

encodings/alp/src/alp/compute/compare.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ where
150150

151151
#[cfg(test)]
152152
mod tests {
153+
use std::f32;
154+
153155
use rstest::rstest;
154156
use vortex_array::ArrayRef;
155157
use vortex_array::LEGACY_SESSION;
@@ -321,8 +323,7 @@ mod tests {
321323

322324
#[test]
323325
fn compare_with_patches() {
324-
let array =
325-
PrimitiveArray::from_iter([1.234f32, 1.5, 19.0, std::f32::consts::E, 1_000_000.9]);
326+
let array = PrimitiveArray::from_iter([1.234f32, 1.5, 19.0, f32::consts::E, 1_000_000.9]);
326327
let encoded = alp_encode(
327328
array.as_view(),
328329
None,

encodings/fastlanes/src/rle/vtable/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use vortex_session::registry::CachedId;
3434
use crate::RLEData;
3535
use crate::rle::array::INDICES_SLOT;
3636
use crate::rle::array::RLEArrayExt;
37+
use crate::rle::array::SLOT_NAMES;
3738
use crate::rle::array::VALUES_IDX_OFFSETS_SLOT;
3839
use crate::rle::array::VALUES_SLOT;
3940
use crate::rle::array::rle_decompress::rle_decompress;
@@ -130,7 +131,7 @@ impl VTable for RLE {
130131
}
131132

132133
fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String {
133-
crate::rle::array::SLOT_NAMES[idx].to_string()
134+
SLOT_NAMES[idx].to_string()
134135
}
135136

136137
fn serialize(

encodings/sparse/src/compute/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ mod test {
126126

127127
#[cfg(test)]
128128
mod tests {
129+
use std::f32;
130+
129131
use rstest::rstest;
130132
use vortex_array::IntoArray;
131133
use vortex_array::arrays::PrimitiveArray;
@@ -164,7 +166,7 @@ mod tests {
164166
).unwrap())]
165167
#[case::sparse_f32(Sparse::try_new(
166168
buffer![2u64, 6].into_array(),
167-
buffer![std::f32::consts::PI, std::f32::consts::E].into_array(),
169+
buffer![f32::consts::PI, f32::consts::E].into_array(),
168170
8,
169171
Scalar::from(0.0f32)
170172
).unwrap())]

vortex-array/src/aggregate_fn/fns/min_max/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ mod tests {
298298
use crate::aggregate_fn::EmptyOptions;
299299
use crate::aggregate_fn::fns::min_max::MinMax;
300300
use crate::aggregate_fn::fns::min_max::MinMaxResult;
301+
use crate::aggregate_fn::fns::min_max::make_minmax_dtype;
301302
use crate::aggregate_fn::fns::min_max::min_max;
302303
use crate::arrays::BoolArray;
303304
use crate::arrays::ChunkedArray;
@@ -451,7 +452,7 @@ mod tests {
451452
let dtype = DType::Primitive(PType::I32, Nullability::NonNullable);
452453
let mut state = MinMax.empty_partial(&EmptyOptions, &dtype)?;
453454

454-
let struct_dtype = crate::aggregate_fn::fns::min_max::make_minmax_dtype(&dtype);
455+
let struct_dtype = make_minmax_dtype(&dtype);
455456
let scalar1 = Scalar::struct_(
456457
struct_dtype.clone(),
457458
vec![Scalar::from(5i32), Scalar::from(15i32)],

vortex-array/src/arrays/constant/compute/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pub(crate) mod uncompressed_size;
1313

1414
#[cfg(test)]
1515
mod test {
16+
use std::f64;
17+
1618
use rstest::rstest;
1719

1820
use crate::IntoArray;
@@ -55,7 +57,7 @@ mod test {
5557
5
5658
))]
5759
// Additional test cases
58-
#[case::constant_f64(ConstantArray::new(Scalar::from(std::f64::consts::PI), 10))]
60+
#[case::constant_f64(ConstantArray::new(Scalar::from(f64::consts::PI), 10))]
5961
#[case::constant_bool(ConstantArray::new(Scalar::from(true), 7))]
6062
#[case::constant_single(ConstantArray::new(Scalar::from(99u64), 1))]
6163
#[case::constant_large(ConstantArray::new(Scalar::from("hello"), 1000))]

0 commit comments

Comments
 (0)