Jefffrey commented on code in PR #5820:
URL: https://github.com/apache/arrow-datafusion/pull/5820#discussion_r1155883766


##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -195,8 +195,12 @@ impl CaseExpr {
                 _ => when_value,
             };
             let when_value = when_value.into_array(batch.num_rows());
-            let when_value = as_boolean_array(&when_value)
-                .expect("WHEN expression did not return a BooleanArray");
+            let when_value = as_boolean_array(&when_value).map_err(|e| {
+                DataFusionError::Context(

Review Comment:
   Yeah figured better to wrap in Context to hopefully provide more informative 
error message



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

Reply via email to