This is an automated email from the ASF dual-hosted git repository.

comphead pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 88dd30504c Remove redundant argument and improve error message (#12217)
88dd30504c is described below

commit 88dd30504cbe9b9e4059f592d8688029c6d35b22
Author: Piotr Findeisen <[email protected]>
AuthorDate: Fri Aug 30 23:19:55 2024 +0200

    Remove redundant argument and improve error message (#12217)
    
    * Remove redundant argument and improve error message
    
    * Update datafusion/functions/src/string/common.rs
    
    Co-authored-by: Oleks V <[email protected]>
    
    * Update datafusion/functions/src/string/common.rs
    
    Co-authored-by: Oleks V <[email protected]>
    
    ---------
    
    Co-authored-by: Oleks V <[email protected]>
---
 datafusion/functions/src/string/common.rs | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/datafusion/functions/src/string/common.rs 
b/datafusion/functions/src/string/common.rs
index a5dc22b4d9..9738cb812f 100644
--- a/datafusion/functions/src/string/common.rs
+++ b/datafusion/functions/src/string/common.rs
@@ -73,15 +73,14 @@ pub(crate) fn general_trim<T: OffsetSizeTrait>(
     };
 
     if use_string_view {
-        string_view_trim::<T>(trim_type, func, args)
+        string_view_trim::<T>(func, args)
     } else {
-        string_trim::<T>(trim_type, func, args)
+        string_trim::<T>(func, args)
     }
 }
 
 // removing 'a will cause compiler complaining lifetime of `func`
 fn string_view_trim<'a, T: OffsetSizeTrait>(
-    trim_type: TrimType,
     func: fn(&'a str, &'a str) -> &'a str,
     args: &'a [ArrayRef],
 ) -> Result<ArrayRef> {
@@ -129,14 +128,13 @@ fn string_view_trim<'a, T: OffsetSizeTrait>(
         }
         other => {
             exec_err!(
-            "{trim_type} was called with {other} arguments. It requires at 
least 1 and at most 2."
+            "Function TRIM was called with {other} arguments. It requires at 
least 1 and at most 2."
             )
         }
     }
 }
 
 fn string_trim<'a, T: OffsetSizeTrait>(
-    trim_type: TrimType,
     func: fn(&'a str, &'a str) -> &'a str,
     args: &'a [ArrayRef],
 ) -> Result<ArrayRef> {
@@ -183,7 +181,7 @@ fn string_trim<'a, T: OffsetSizeTrait>(
         }
         other => {
             exec_err!(
-            "{trim_type} was called with {other} arguments. It requires at 
least 1 and at most 2."
+            "Function TRIM was called with {other} arguments. It requires at 
least 1 and at most 2."
             )
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to