alamb commented on code in PR #14220:
URL: https://github.com/apache/datafusion/pull/14220#discussion_r1926047838


##########
datafusion/expr-common/src/columnar_value.rs:
##########
@@ -218,6 +220,28 @@ impl ColumnarValue {
     }
 }
 
+// Implement Display trait for ColumnarValue
+//
+// # Panics

Review Comment:
   In general I think it would be surprising of a Display impl `panic`d. 
   
   Instead in this case perhaps we can convert the errors to a string
   
   One way to do that is instead of
   
   ```rust
   pretty_format_columns("ColumnarValue(ArrayRef)", &[Arc::clone(array)])
                       .unwrap()
   ```
   
   You can fallback on error like this:
   
   ```rust
                   if let Ok(formatted) = 
pretty_format_columns("ColumnarValue(ArrayRef)", &[Arc::clone(array)]) {
                       write!(f, "{}", formatted)
                   } else {
                       write!(f, "Error formatting columnar value")
                   }
   ```



-- 
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