Skip to content

Commit

Permalink
refactor(cubesql): Fix op_ref warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mcheshkov committed Feb 24, 2025
1 parent f01b7b9 commit 87123c5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion rust/cubesql/cubesql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ new_without_default = "allow"
non_canonical_partial_ord_impl = "allow"
nonminimal_bool = "allow"
only_used_in_recursion = "allow"
op_ref = "allow"
option_as_ref_deref = "allow"
partialeq_ne_impl = "allow"
ptr_arg = "allow"
Expand Down
6 changes: 3 additions & 3 deletions rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,13 +1322,13 @@ impl CubeScanWrapperNode {
let aliased_column = aggr_expr
.iter()
.find_position(|e| {
expr_name(e, &schema).map(|n| &n == &col_name).unwrap_or(false)
expr_name(e, &schema).map(|n| n == col_name).unwrap_or(false)
})
.map(|(i, _)| aggregate[i].clone()).or_else(|| {
projection_expr
.iter()
.find_position(|e| {
expr_name(e, &schema).map(|n| &n == &col_name).unwrap_or(false)
expr_name(e, &schema).map(|n| n == col_name).unwrap_or(false)

Check warning on line 1331 in rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs

View check run for this annotation

Codecov / codecov/patch

rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs#L1331

Added line #L1331 was not covered by tests
})
.map(|(i, _)| {
projection[i].clone()
Expand All @@ -1337,7 +1337,7 @@ impl CubeScanWrapperNode {
flat_group_expr
.iter()
.find_position(|e| {
expr_name(e, &schema).map(|n| &n == &col_name).unwrap_or(false)
expr_name(e, &schema).map(|n| n == col_name).unwrap_or(false)
})
.map(|(i, _)| group_by[i].clone())
}).ok_or_else(|| {
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/src/compile/engine/udf/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ pub fn create_convert_tz_udf() -> ScalarUDF {
}

if let Some(tz) = input_tz {
if tz != &"UTC" {
if tz != "UTC" {
return Err(DataFusionError::NotImplemented(format!(
"convert_tz does not non UTC timezone as input, actual {}",
tz
Expand Down
4 changes: 2 additions & 2 deletions rust/cubesql/cubesql/src/compile/rewrite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ impl LogicalPlanData {
{
{
let column_name = expr_column_name(&expr, &None);
let equal = name == &column_name;
let equal = name == column_name;
let _ = member_names_to_expr
.cached_lookups
.try_insert(column_name, index);
Expand All @@ -702,7 +702,7 @@ impl LogicalPlanData {
}
{
let column_name = expr_column_name_with_relation(&expr, &mut relation);
let equal = name == &column_name;
let equal = name == column_name;
let _ = member_names_to_expr
.cached_lookups
.try_insert(column_name, index);
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/src/sql/postgres/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl ToProtocolValue for TimestampValue {

match self.tz_ref() {
None => as_str.to_text(buf),
Some(_) => (as_str + &"+00").to_text(buf),
Some(_) => (as_str + "+00").to_text(buf),
}
}

Expand Down

0 comments on commit 87123c5

Please sign in to comment.