Skip to content

Commit 4a865d3

Browse files
chore: update some error messages for clarity
1 parent cc60278 commit 4a865d3

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

datafusion/expr/src/expr_schema.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl ExprSchemable for Expr {
141141
// verify that function is invoked with correct number and type of arguments as defined in `TypeSignature`
142142
data_types_with_scalar_udf(&arg_data_types, func).map_err(|err| {
143143
plan_datafusion_err!(
144-
"{} and {}",
144+
"{} {}",
145145
err,
146146
utils::generate_signature_error_msg(
147147
func.name(),
@@ -164,7 +164,7 @@ impl ExprSchemable for Expr {
164164
WindowFunctionDefinition::AggregateUDF(udf) => {
165165
let new_types = data_types_with_aggregate_udf(&data_types, udf).map_err(|err| {
166166
plan_datafusion_err!(
167-
"{} and {}",
167+
"{} {}",
168168
err,
169169
utils::generate_signature_error_msg(
170170
fun.name(),
@@ -192,7 +192,7 @@ impl ExprSchemable for Expr {
192192
AggregateFunctionDefinition::UDF(fun) => {
193193
let new_types = data_types_with_aggregate_udf(&data_types, fun).map_err(|err| {
194194
plan_datafusion_err!(
195-
"{} and {}",
195+
"{} {}",
196196
err,
197197
utils::generate_signature_error_msg(
198198
fun.name(),

datafusion/expr/src/type_coercion/functions.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ pub fn data_types_with_scalar_udf(
4949
if signature.type_signature.supports_zero_argument() {
5050
return Ok(vec![]);
5151
} else {
52-
return plan_err!(
53-
"[data_types_with_scalar_udf] signature {:?} does not support zero arguments.",
54-
&signature.type_signature
55-
);
52+
return plan_err!("{} does not support zero arguments.", func.name());
5653
}
5754
}
5855

@@ -79,11 +76,7 @@ pub fn data_types_with_aggregate_udf(
7976
if signature.type_signature.supports_zero_argument() {
8077
return Ok(vec![]);
8178
} else {
82-
return plan_err!(
83-
"[data_types_with_aggregate_udf] Coercion from {:?} to the signature {:?} failed.",
84-
current_types,
85-
&signature.type_signature
86-
);
79+
return plan_err!("{} does not support zero arguments.", func.name());
8780
}
8881
}
8982

@@ -118,8 +111,7 @@ pub fn data_types(
118111
return Ok(vec![]);
119112
} else {
120113
return plan_err!(
121-
"[data_types] Coercion from {:?} to the signature {:?} failed.",
122-
current_types,
114+
"signature {:?} does not support zero arguments.",
123115
&signature.type_signature
124116
);
125117
}

0 commit comments

Comments
 (0)