mirror of
https://github.com/Canner/WrenAI.git
synced 2026-08-30 18:00:36 +08:00
fix(core): address Rust 1.97 Clippy warnings (#2479)
This commit is contained in:
@@ -1054,7 +1054,7 @@ mod test {
|
||||
Err(_) => {}
|
||||
_ => panic!(
|
||||
"should be error: {}",
|
||||
&headers.get("session_id").unwrap().as_ref().unwrap()
|
||||
headers.get("session_id").unwrap().as_ref().unwrap()
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ fn collect_model_required_fields(
|
||||
return plan_err!("Only support calculated field with expression");
|
||||
}
|
||||
.alias(column.name.clone());
|
||||
debug!("Required Calculated field: {}", &expr_plan);
|
||||
debug!("Required Calculated field: {}", expr_plan);
|
||||
required_fields
|
||||
.entry(relation_ref.clone())
|
||||
.or_default()
|
||||
@@ -800,7 +800,7 @@ fn collect_model_required_fields(
|
||||
Arc::clone(&session_state_ref),
|
||||
Arc::clone(&session_properties),
|
||||
)?;
|
||||
debug!("Required field: {}", &expr_plan);
|
||||
debug!("Required field: {}", expr_plan);
|
||||
required_fields
|
||||
.entry(relation_ref.clone())
|
||||
.or_default()
|
||||
|
||||
@@ -271,7 +271,7 @@ fn resolve_measures(
|
||||
let mut sorted_deps = deps.clone();
|
||||
sorted_deps.sort_by_key(|d| std::cmp::Reverse(d.len()));
|
||||
for dep in sorted_deps {
|
||||
let replacement = format!("({})", &resolved[dep]);
|
||||
let replacement = format!("({})", resolved[dep]);
|
||||
// NoExpand keeps `$1`, `$$tag$$` etc. literal — without it
|
||||
// Regex::replace_all would treat them as capture-group templates
|
||||
// and corrupt SQL expressions that contain `$`.
|
||||
|
||||
@@ -215,7 +215,7 @@ impl WrenMDL {
|
||||
});
|
||||
});
|
||||
WrenMDL {
|
||||
catalog_schema_prefix: format!("{}.{}.", &manifest.catalog, &manifest.schema),
|
||||
catalog_schema_prefix: format!("{}.{}.", manifest.catalog, manifest.schema),
|
||||
manifest,
|
||||
qualified_references: qualifed_references,
|
||||
register_tables: HashMap::new(),
|
||||
|
||||
@@ -43,7 +43,7 @@ pub(crate) fn convert_batches(batches: Vec<RecordBatch>) -> Result<Vec<Vec<Strin
|
||||
return Err(DFSqlLogicTestError::DataFusion(DataFusionError::Internal(
|
||||
format!(
|
||||
"Schema mismatch. Previously had\n{:#?}\n\nGot:\n{:#?}",
|
||||
&schema,
|
||||
schema,
|
||||
batch.schema()
|
||||
),
|
||||
)));
|
||||
|
||||
@@ -87,7 +87,7 @@ async fn main() -> datafusion::common::Result<()> {
|
||||
println!("#####################");
|
||||
println!(
|
||||
"session_tenant_id: {}",
|
||||
&properties
|
||||
properties
|
||||
.get("session_tenant_id")
|
||||
.unwrap()
|
||||
.clone()
|
||||
@@ -95,7 +95,7 @@ async fn main() -> datafusion::common::Result<()> {
|
||||
);
|
||||
println!(
|
||||
"session_department: {}",
|
||||
&properties
|
||||
properties
|
||||
.get("session_department")
|
||||
.unwrap()
|
||||
.clone()
|
||||
@@ -103,11 +103,11 @@ async fn main() -> datafusion::common::Result<()> {
|
||||
);
|
||||
println!(
|
||||
"session_user_id: {}",
|
||||
&properties.get("session_user_id").unwrap().clone().unwrap()
|
||||
properties.get("session_user_id").unwrap().clone().unwrap()
|
||||
);
|
||||
println!(
|
||||
"session_role: {}",
|
||||
&properties.get("session_role").unwrap().clone().unwrap()
|
||||
properties.get("session_role").unwrap().clone().unwrap()
|
||||
);
|
||||
|
||||
let sql = "select * from wren.test.documents";
|
||||
|
||||
Reference in New Issue
Block a user