Skip to content

Commit

Permalink
chore: update some error messages for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyssmith2nd committed Jun 14, 2024
1 parent d87d5db commit 006f936
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 3 additions & 3 deletions datafusion/expr/src/expr_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl ExprSchemable for Expr {
// verify that function is invoked with correct number and type of arguments as defined in `TypeSignature`
data_types_with_scalar_udf(&arg_data_types, func).map_err(|err| {
plan_datafusion_err!(
"{} and {}",
"{} {}",
err,
utils::generate_signature_error_msg(
func.name(),
Expand All @@ -164,7 +164,7 @@ impl ExprSchemable for Expr {
WindowFunctionDefinition::AggregateUDF(udf) => {
let new_types = data_types_with_aggregate_udf(&data_types, udf).map_err(|err| {
plan_datafusion_err!(
"{} and {}",
"{} {}",
err,
utils::generate_signature_error_msg(
fun.name(),
Expand Down Expand Up @@ -192,7 +192,7 @@ impl ExprSchemable for Expr {
AggregateFunctionDefinition::UDF(fun) => {
let new_types = data_types_with_aggregate_udf(&data_types, fun).map_err(|err| {
plan_datafusion_err!(
"{} and {}",
"{} {}",
err,
utils::generate_signature_error_msg(
fun.name(),
Expand Down
14 changes: 3 additions & 11 deletions datafusion/expr/src/type_coercion/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ pub fn data_types_with_scalar_udf(
if signature.type_signature.supports_zero_argument() {
return Ok(vec![]);
} else {
return plan_err!(
"[data_types_with_scalar_udf] signature {:?} does not support zero arguments.",
&signature.type_signature
);
return plan_err!("{} does not support zero arguments.", func.name());
}
}

Expand All @@ -79,11 +76,7 @@ pub fn data_types_with_aggregate_udf(
if signature.type_signature.supports_zero_argument() {
return Ok(vec![]);
} else {
return plan_err!(
"[data_types_with_aggregate_udf] Coercion from {:?} to the signature {:?} failed.",
current_types,
&signature.type_signature
);
return plan_err!("{} does not support zero arguments.", func.name());
}
}

Expand Down Expand Up @@ -118,8 +111,7 @@ pub fn data_types(
return Ok(vec![]);
} else {
return plan_err!(
"[data_types] Coercion from {:?} to the signature {:?} failed.",
current_types,
"signature {:?} does not support zero arguments.",
&signature.type_signature
);
}
Expand Down

0 comments on commit 006f936

Please sign in to comment.