mbrobbel commented on code in PR #14511:
URL: https://github.com/apache/datafusion/pull/14511#discussion_r1943148440


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -170,26 +170,34 @@ pub fn data_types(
         } else if type_signature.used_to_support_zero_arguments() {
             // Special error to help during upgrade: 
https://github.com/apache/datafusion/issues/13763
             return plan_err!(
-                "signature {:?} does not support zero arguments. Use 
TypeSignature::Nullary for zero arguments.",
+                "function {} has signature {:?} which does not support zero 
arguments. Use TypeSignature::Nullary for zero arguments.",
+                function_name.as_ref(),
                 type_signature
             );
         } else {
             return plan_err!(
-                "signature {:?} does not support zero arguments.",
+                "Function {} has signature {:?} which does not support zero 
arguments.",
+                function_name.as_ref(),
                 type_signature

Review Comment:
   ```suggestion
                   "Function {} has signature {type_signature:?} which does not 
support zero arguments.",
                   function_name.as_ref()
   ```



##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -295,7 +308,13 @@ fn get_valid_types_with_aggregate_udf(
     let valid_types = match signature {
         TypeSignature::UserDefined => match func.coerce_types(current_types) {
             Ok(coerced_types) => vec![coerced_types],
-            Err(e) => return exec_err!("User-defined coercion failed with 
{:?}", e),
+            Err(e) => {
+                return exec_err!(
+                    "Function {} user-defined coercion failed with {:?}",
+                    func.name(),
+                    e

Review Comment:
   ```suggestion
                       "Function {} user-defined coercion failed with {e:?}",
                       func.name()
   ```



##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -257,7 +265,11 @@ fn get_valid_types_with_scalar_udf(
     match signature {
         TypeSignature::UserDefined => match func.coerce_types(current_types) {
             Ok(coerced_types) => Ok(vec![coerced_types]),
-            Err(e) => exec_err!("User-defined coercion failed with {:?}", e),
+            Err(e) => exec_err!(
+                "Function {} user-defined coercion failed with {:?}",
+                func.name(),
+                e

Review Comment:
   ```suggestion
                   "Function {} user-defined coercion failed with {e:?}",
                   func.name()
   ```



##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -318,25 +337,33 @@ fn get_valid_types_with_window_udf(
     let valid_types = match signature {
         TypeSignature::UserDefined => match func.coerce_types(current_types) {
             Ok(coerced_types) => vec![coerced_types],
-            Err(e) => return exec_err!("User-defined coercion failed with 
{:?}", e),
+            Err(e) => {
+                return exec_err!(
+                    "Function {} user-defined coercion failed with {:?}",
+                    func.name(),
+                    e

Review Comment:
   ```suggestion
                       "Function {} user-defined coercion failed with {e:?}",
                       func.name()
   ```



-- 
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-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to