You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "findepi (via GitHub)" <gi...@apache.org> on 2024/11/28 18:16:40 UTC
[PR] Apply clippy fixes [datafusion]
findepi opened a new pull request, #13596:
URL: https://github.com/apache/datafusion/pull/13596
`dev/rust_lint.sh` no longer passes for me, maybe because of `rustup update`. This is first portion of fixes suggested by clippy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#issuecomment-2506737552
> I think we need to `#allow[missing_docs]` as the clippy now complains on that
:) just added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on code in PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#discussion_r1862667573
##########
datafusion/optimizer/src/replace_distinct_aggregate.rs:
##########
@@ -54,8 +54,6 @@ use datafusion_expr::{Aggregate, Distinct, DistinctOn, Expr, LogicalPlan};
/// )
/// ORDER BY a DESC
/// ```
-
-/// Optimizer that replaces logical [[Distinct]] with a logical [[Aggregate]]
Review Comment:
it duplicates the first line of the long comment above, i don't think it's needed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#issuecomment-2506738154
now that https://github.com/apache/datafusion/pull/13598 is merged, let be rebase, otherwise we no longer test with 1.83
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "jonahgao (via GitHub)" <gi...@apache.org>.
jonahgao commented on PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#issuecomment-2506949744
Thanks @findepi @comphead @Dandandan
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#issuecomment-2506762313
[clippy](https://github.com/apache/datafusion/actions/runs/12075224493/job/33674907768?pr=13596#logs) job passed with toolchain pin dropped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#discussion_r1862634805
##########
datafusion/functions-nested/src/concat.rs:
##########
@@ -438,7 +438,7 @@ fn concat_internal<O: OffsetSizeTrait>(args: &[ArrayRef]) -> Result<ArrayRef> {
Ok(Arc::new(list_arr))
}
-/// Kernal functions
+// Kernal functions
Review Comment:
```suggestion
// Kernel functions
```
##########
datafusion/expr-common/src/type_coercion/aggregates.rs:
##########
@@ -294,19 +294,19 @@ pub fn coerce_avg_type(func_name: &str, arg_types: &[DataType]) -> Result<Vec<Da
// Supported types smallint, int, bigint, real, double precision, decimal, or interval
// Refer to https://www.postgresql.org/docs/8.2/functions-aggregate.html doc
fn coerced_type(func_name: &str, data_type: &DataType) -> Result<DataType> {
- return match &data_type {
+ match &data_type {
DataType::Decimal128(p, s) => Ok(DataType::Decimal128(*p, *s)),
DataType::Decimal256(p, s) => Ok(DataType::Decimal256(*p, *s)),
d if d.is_numeric() => Ok(DataType::Float64),
- DataType::Dictionary(_, v) => return coerced_type(func_name, v.as_ref()),
Review Comment:
oh that becomes a clippy complaint finally
##########
datafusion/expr/src/logical_plan/display.rs:
##########
@@ -181,7 +181,7 @@ impl<'a, 'b> GraphvizVisitor<'a, 'b> {
}
}
-impl<'n, 'a, 'b> TreeNodeVisitor<'n> for GraphvizVisitor<'a, 'b> {
Review Comment:
the underscore does it mean unused lifetime?
##########
datafusion/physical-plan/src/sorts/sort_preserving_merge.rs:
##########
@@ -746,7 +746,7 @@ mod tests {
// Split the provided record batch into multiple batch_size record batches
fn split_batch(sorted: &RecordBatch, batch_size: usize) -> Vec<RecordBatch> {
- let batches = (sorted.num_rows() + batch_size - 1) / batch_size;
Review Comment:
was it a clippy complaint?
##########
datafusion/optimizer/src/replace_distinct_aggregate.rs:
##########
@@ -54,8 +54,6 @@ use datafusion_expr::{Aggregate, Distinct, DistinctOn, Expr, LogicalPlan};
/// )
/// ORDER BY a DESC
/// ```
-
-/// Optimizer that replaces logical [[Distinct]] with a logical [[Aggregate]]
Review Comment:
do we need the comment to be removed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#discussion_r1862643735
##########
datafusion/expr/src/logical_plan/display.rs:
##########
@@ -181,7 +181,7 @@ impl<'a, 'b> GraphvizVisitor<'a, 'b> {
}
}
-impl<'n, 'a, 'b> TreeNodeVisitor<'n> for GraphvizVisitor<'a, 'b> {
Review Comment:
https://doc.rust-lang.org/reference/lifetime-elision.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "jonahgao (via GitHub)" <gi...@apache.org>.
jonahgao merged PR #13596:
URL: https://github.com/apache/datafusion/pull/13596
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on code in PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#discussion_r1862667940
##########
datafusion/physical-plan/src/sorts/sort_preserving_merge.rs:
##########
@@ -746,7 +746,7 @@ mod tests {
// Split the provided record batch into multiple batch_size record batches
fn split_batch(sorted: &RecordBatch, batch_size: usize) -> Vec<RecordBatch> {
- let batches = (sorted.num_rows() + batch_size - 1) / batch_size;
Review Comment:
i did not modify this line manually. but i did run clippy with `--fix`, so yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#discussion_r1862668685
##########
datafusion/physical-plan/src/sorts/sort_preserving_merge.rs:
##########
@@ -746,7 +746,7 @@ mod tests {
// Split the provided record batch into multiple batch_size record batches
fn split_batch(sorted: &RecordBatch, batch_size: usize) -> Vec<RecordBatch> {
- let batches = (sorted.num_rows() + batch_size - 1) / batch_size;
Review Comment:
thanks, clippy got smart
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Apply clippy fixes for Rust 1.83 [datafusion]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on PR #13596:
URL: https://github.com/apache/datafusion/pull/13596#issuecomment-2506736284
I think we need to `#allow[missing_docs]` as the clippy now complains on that
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org