Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 55 additions & 64 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -269,70 +269,61 @@ wildcard_dependencies = "warn"

# Pedantic lints we opt out of, with the number of hits at the time we enabled `pedantic`.
# Some of these we should consider enabling.
borrow_as_ptr = "allow" # 6 hits
case_sensitive_file_extension_comparisons = "allow" # 1 hit
cast_lossless = "allow" # 361 hits
cast_possible_truncation = "allow" # 911 hits
cast_possible_wrap = "allow" # 493 hits
cast_precision_loss = "allow" # 266 hits
cast_ptr_alignment = "allow" # 5 hits
cast_sign_loss = "allow" # 440 hits
cloned_instead_of_copied = "allow" # 38 hits
default_trait_access = "allow" # 221 hits
doc_comment_double_space_linebreaks = "allow" # 6 hits
doc_link_with_quotes = "allow" # 25 hits
doc_markdown = "allow" # 4933 hits; needs a long `doc-valid-idents` list in `clippy.toml`
enum_glob_use = "allow" # 98 hits
explicit_into_iter_loop = "allow" # 55 hits
explicit_iter_loop = "allow" # 189 hits
float_cmp = "allow" # 8 hits; exact float comparisons are often intentional here
format_collect = "allow" # 4 hits
format_push_string = "allow" # 34 hits
from_iter_instead_of_collect = "allow" # 51 hits
if_not_else = "allow" # 133 hits
ignored_unit_patterns = "allow" # 52 hits
implicit_clone = "allow" # 198 hits
implicit_hasher = "allow" # 17 hits
inline_always = "allow" # 45 hits
items_after_statements = "allow" # 171 hits
large_digit_groups = "allow" # 3 hits
manual_string_new = "allow" # 84 hits
many_single_char_names = "allow" # 12 hits; short names are idiomatic in the numeric kernels
map_unwrap_or = "allow" # 198 hits
match_bool = "allow" # 46 hits
match_same_arms = "allow" # 261 hits
match_wildcard_for_single_variants = "allow" # 132 hits
missing_errors_doc = "allow" # 1807 hits
missing_fields_in_debug = "allow" # 29 hits
missing_panics_doc = "allow" # 244 hits
must_use_candidate = "allow" # 2726 hits
needless_bitwise_bool = "allow" # 1 hit
needless_continue = "allow" # 37 hits
needless_raw_string_hashes = "allow" # 540 hits
no_effect_underscore_binding = "allow" # 1 hit
ptr_as_ptr = "allow" # 83 hits
redundant_closure_for_method_calls = "allow" # 686 hits
redundant_else = "allow" # 48 hits
ref_option = "allow" # 36 hits
return_self_not_must_use = "allow" # 644 hits
semicolon_if_nothing_returned = "allow" # 1353 hits
similar_names = "allow" # 228 hits; too many false positives, e.g. `expr`/`exprs`
single_char_pattern = "allow" # 23 hits
single_match_else = "allow" # 155 hits
struct_excessive_bools = "allow" # 24 hits
struct_field_names = "allow" # 14 hits
too_many_lines = "allow" # 484 hits
trivially_copy_pass_by_ref = "allow" # 74 hits
unicode_not_nfc = "allow" # 2 hits
unnecessary_literal_bound = "allow" # 471 hits
unnecessary_semicolon = "allow" # 185 hits
unnecessary_trailing_comma = "allow" # 49 hits
unnecessary_wraps = "allow" # 427 hits
unnested_or_patterns = "allow" # 68 hits
unreadable_literal = "allow" # 502 hits
unused_self = "allow" # 69 hits
used_underscore_items = "allow" # 28 hits
wildcard_imports = "allow" # 48 hits; `use crate::prelude::*` is idiomatic
borrow_as_ptr = "allow" # 6 hits
cast_lossless = "allow" # 361 hits
cast_possible_truncation = "allow" # 911 hits
cast_possible_wrap = "allow" # 493 hits
cast_precision_loss = "allow" # 266 hits
cast_sign_loss = "allow" # 440 hits
default_trait_access = "allow" # 221 hits
doc_comment_double_space_linebreaks = "allow" # 6 hits
doc_markdown = "allow" # 4933 hits; needs a long `doc-valid-idents` list in `clippy.toml`
enum_glob_use = "allow" # 98 hits
explicit_into_iter_loop = "allow" # 55 hits
explicit_iter_loop = "allow" # 189 hits
float_cmp = "allow" # 8 hits; exact float comparisons are often intentional here
format_collect = "allow" # 4 hits
format_push_string = "allow" # 34 hits
from_iter_instead_of_collect = "allow" # 51 hits
if_not_else = "allow" # 133 hits
ignored_unit_patterns = "allow" # 52 hits
implicit_clone = "allow" # 198 hits
implicit_hasher = "allow" # 17 hits
inline_always = "allow" # 45 hits
items_after_statements = "allow" # 171 hits
large_digit_groups = "allow" # 3 hits
manual_string_new = "allow" # 84 hits
many_single_char_names = "allow" # 12 hits; short names are idiomatic in the numeric kernels
map_unwrap_or = "allow" # 198 hits
match_bool = "allow" # 46 hits
match_same_arms = "allow" # 261 hits
match_wildcard_for_single_variants = "allow" # 132 hits
missing_errors_doc = "allow" # 1807 hits
missing_fields_in_debug = "allow" # 29 hits
missing_panics_doc = "allow" # 244 hits
must_use_candidate = "allow" # 2726 hits
needless_bitwise_bool = "allow" # 1 hit
needless_raw_string_hashes = "allow" # 540 hits
ptr_as_ptr = "allow" # 83 hits
redundant_closure_for_method_calls = "allow" # 686 hits
redundant_else = "allow" # 48 hits
return_self_not_must_use = "allow" # 644 hits
semicolon_if_nothing_returned = "allow" # 1353 hits
similar_names = "allow" # 228 hits; too many false positives, e.g. `expr`/`exprs`
single_char_pattern = "allow" # 23 hits
single_match_else = "allow" # 155 hits
struct_excessive_bools = "allow" # 24 hits
struct_field_names = "allow" # 14 hits
too_many_lines = "allow" # 484 hits
trivially_copy_pass_by_ref = "allow" # 74 hits
unicode_not_nfc = "allow" # 2 hits
unnecessary_literal_bound = "allow" # 471 hits
unnecessary_wraps = "allow" # 427 hits
unnested_or_patterns = "allow" # 68 hits
unreadable_literal = "allow" # 502 hits
unused_self = "allow" # 69 hits
used_underscore_items = "allow" # 28 hits
wildcard_imports = "allow" # 48 hits; `use crate::prelude::*` is idiomatic

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/src/imdb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pub fn get_query_sql(query: &str) -> Result<Vec<String>> {
.collect());
}
Err(e) => errors.push(format!("{filename}: {e}")),
};
}
}
plan_err!("invalid query. Could not find query: {:?}", errors)
}
2 changes: 1 addition & 1 deletion benchmarks/src/tpcds/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub fn get_query_sql(base_query_path: &str, query: usize) -> Result<Vec<String>>
.collect());
}
Err(e) => errors.push(format!("{filename}: {e}")),
};
}

plan_err!("invalid query. Could not find query: {:?}", errors)
} else {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/src/tpch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub fn get_query_sql_for_scale_factor(
.collect());
}
Err(e) => errors.push(format!("{filename}: {e}")),
};
}
}
plan_err!("invalid query. Could not find query: {:?}", errors)
} else {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/src/util/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl BenchmarkRun {
pub fn maybe_write_json(&self, maybe_path: Option<impl AsRef<Path>>) -> Result<()> {
if let Some(path) = maybe_path {
std::fs::write(path, self.to_json())?;
};
}
Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion-cli/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl SchemaProvider for DynamicObjectStoreSchemaProvider {
}
}
_ => {}
};
}
state = builder.build();
let store = get_object_store(
&state,
Expand Down
8 changes: 1 addition & 7 deletions datafusion-cli/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,7 @@ pub async fn exec_from_lines(

for line in reader.lines() {
match line {
Ok(line) if line.starts_with("#!") => {
continue;
}
Ok(line) if line.starts_with("--") => {
continue;
}
Ok(line) if line.starts_with("#!") || line.starts_with("--") => {}
Ok(line) => {
let line = line.trim_end();
query.push_str(line);
Expand Down Expand Up @@ -197,7 +192,6 @@ pub async fn exec_from_repl(
Err(ReadlineError::Interrupted) => {
println!("^C");
rl.helper().unwrap().reset_hint();
continue;
}
Err(ReadlineError::Eof) => {
println!("\\q");
Expand Down
2 changes: 1 addition & 1 deletion datafusion-cli/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ impl TableFunctionImpl for ParquetMetadataFunc {
stats_distinct_count_arr.push(None);
stats_min_value_arr.push(None);
stats_max_value_arr.push(None);
};
}
compression_arr.push(format!("{:?}", column.compression()));
// need to collect into Vec to format
let encodings: Vec<_> = column.encodings().collect();
Expand Down
4 changes: 2 additions & 2 deletions datafusion-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async fn main_inner() -> Result<()> {
if let Some(ref path) = args.data_path {
let p = Path::new(path);
env::set_current_dir(p).unwrap();
};
}

let session_config = get_session_config(&args)?;

Expand Down Expand Up @@ -353,7 +353,7 @@ fn get_session_config(args: &Args) -> Result<SessionConfig> {
}
config_options.execution.batch_size =
datafusion_common::config::ConfigNonZeroUsize::try_new(batch_size)?;
};
}

// use easier to understand "tree" mode by default
// if the user hasn't specified an explain format in the environment
Expand Down
2 changes: 1 addition & 1 deletion datafusion-cli/src/print_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl PrintOptions {
return Err(DataFusionError::External(
"PrintFormat::Table is not implemented".to_string().into(),
));
};
}

let stdout = io::stdout();
let mut writer = stdout.lock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ fn read_distinct_index(path: &Path) -> Result<DistinctIndex> {
let file = File::open(path)?;

let file_size = file.metadata()?.len();
println!("Reading index from {} (size: {file_size})", path.display(),);
println!("Reading index from {} (size: {file_size})", path.display());

let reader = SerializedFileReader::new(file.try_clone()?)?;
let meta = reader.metadata().file_metadata();
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/data_io/parquet_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ impl Display for ParquetMetadataIndex {
self.last_num_pruned()
)?;
let batches = pretty_format_batches(std::slice::from_ref(&self.index)).unwrap();
write!(f, "{batches}",)
write!(f, "{batches}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/query_planning/pruning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ fn create_pruning_predicate(expr: Expr, schema: &SchemaRef) -> PruningPredicate
}

fn i32_array<'a>(values: impl Iterator<Item = &'a Option<i32>>) -> ArrayRef {
Arc::new(Int32Array::from_iter(values.cloned()))
Arc::new(Int32Array::from_iter(values.copied()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl Drop for CpuRuntime {
// If the thread is still running, we wait for it to finish
print!("Shutting down CPU runtime thread...");
if let Err(e) = thread_join_handle.join() {
eprintln!("Error joining CPU runtime thread: {e:?}",);
eprintln!("Error joining CPU runtime thread: {e:?}");
} else {
println!("CPU runtime thread shutdown successfully.");
}
Expand Down
6 changes: 3 additions & 3 deletions datafusion/catalog-listing/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ pub async fn pruned_partition_list<'a>(
.try_filter_map(|object_meta| {
futures::future::ready(object_meta_to_partitioned_file(
object_meta,
table_path.get_table_ref(),
table_path.get_table_ref().as_ref(),
))
})
.boxed())
Expand Down Expand Up @@ -443,7 +443,7 @@ pub async fn pruned_partition_list<'a>(

fn object_meta_to_partitioned_file(
object_meta: ObjectMeta,
table_ref: &Option<TableReference>,
table_ref: Option<&TableReference>,
) -> Result<Option<PartitionedFile>> {
Ok(Some(PartitionedFile {
object_meta,
Expand All @@ -454,7 +454,7 @@ fn object_meta_to_partitioned_file(
ordering: None,
extensions: FileExtensions::new(),
metadata_size_hint: None,
table_reference: table_ref.clone(),
table_reference: table_ref.cloned(),
}))
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/catalog-listing/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ impl ListingTable {
}
}
None => {} // no ordering required
};
}

let output_partitioning = if let Some(output_partitioning) =
declared_output_partitioning
Expand Down
2 changes: 1 addition & 1 deletion datafusion/catalog/src/dynamic_file/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl SchemaProvider for DynamicFileSchemaProvider {
) -> datafusion_common::Result<Option<Arc<dyn TableProvider>>> {
if let Some(table) = self.inner.table(name).await? {
return Ok(Some(table));
};
}

self.factory.try_new(name).await
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/common/src/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Column {
.flat_map(|s| s.qualified_fields_with_unqualified_name(&self.name))
.collect::<Vec<_>>();
match qualified_fields.len() {
0 => continue,
0 => {}
1 => return Ok(Column::from(qualified_fields[0])),
_ => {
// More than 1 fields in this schema have their names set to self.name.
Expand Down
4 changes: 2 additions & 2 deletions datafusion/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ impl ConfigField for ConfigFileEncryptionProperties {
if key.contains("::") {
// Handle any column specific properties
return self.column_encryption_properties.set(key, value);
};
}

let (key, rem) = key.split_once('.').unwrap_or((key, ""));
match key {
Expand Down Expand Up @@ -3463,7 +3463,7 @@ impl ConfigField for ConfigFileDecryptionProperties {
if key.contains("::") {
// Handle any column specific properties
return self.column_decryption_properties.set(key, value);
};
}

let (key, rem) = key.split_once('.').unwrap_or((key, ""));
match key {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ mod test {
match std::env::var("RUST_BACKTRACE") {
Ok(val) if val == "1" => {}
_ => panic!("Environment variable RUST_BACKTRACE must be set to 1"),
};
}
}

// To pass the test the environment variable RUST_BACKTRACE should be set to 1 to enforce backtrace
Expand Down
Loading
Loading