junjunjd commented on code in PR #7901:
URL: https://github.com/apache/arrow-datafusion/pull/7901#discussion_r1379688238


##########
datafusion/common/src/scalar.rs:
##########
@@ -676,13 +696,13 @@ macro_rules! build_values_list {
                     ScalarValue::$SCALAR_TY(None) => {
                         builder.values().append_null();
                     }
-                    _ => panic!("Incompatible ScalarValue for list"),

Review Comment:
   This error can be unreachable if an invariant is established that the 
`data_type` and `values` arguments passed to 
[`new_list`](https://github.com/apache/arrow-datafusion/blob/main/datafusion/common/src/scalar.rs#L1664)
 align with each other. 
   With the above invariant established, we can change this back to `panic` and 
thus making `new_list` panic instead of returning `Result`.



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