comphead commented on code in PR #17921:
URL: https://github.com/apache/datafusion/pull/17921#discussion_r2408270508


##########
datafusion/functions/src/encoding/inner.rs:
##########
@@ -309,18 +309,15 @@ fn hex_decode(input: &[u8], buf: &mut [u8]) -> 
Result<usize> {
     // only write input / 2 bytes to buf
     let out_len = input.len() / 2;
     let buf = &mut buf[..out_len];
-    hex::decode_to_slice(input, buf).map_err(|e| {
-        DataFusionError::Internal(format!("Failed to decode from hex: {e}"))
-    })?;
+    hex::decode_to_slice(input, buf)
+        .map_err(|e| internal_datafusion_err!("Failed to decode from hex: {}", 
e))?;
     Ok(out_len)
 }
 
 fn base64_decode(input: &[u8], buf: &mut [u8]) -> Result<usize> {
     general_purpose::STANDARD_NO_PAD
         .decode_slice(input, buf)
-        .map_err(|e| {
-            DataFusionError::Internal(format!("Failed to decode from base64: 
{e}"))
-        })
+        .map_err(|e| internal_datafusion_err!("Failed to decode from base64: 
{}", e))

Review Comment:
   this is how Claude works 🤔 Thanks for pointing this out



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to