junjunjd commented on code in PR #7901:
URL: https://github.com/apache/arrow-datafusion/pull/7901#discussion_r1381220530
##########
datafusion/common/src/scalar.rs:
##########
@@ -1834,30 +1883,31 @@ impl ScalarValue {
}
let arr = Decimal128Array::from(vals)
- .with_precision_and_scale(*precision, *scale)
- .unwrap();
+ .with_precision_and_scale(*precision, *scale)?;
wrap_into_list_array(Arc::new(arr))
}
DataType::Null => {
let arr = new_null_array(&DataType::Null, values.len());
wrap_into_list_array(arr)
}
- _ => panic!(
- "Unsupported data type {:?} for ScalarValue::list_to_array",
- data_type
- ),
Review Comment:
By updating `try_new_decimal128` to disallow decimal with precision 0 and
establishing some invariants, errors in `new_list` should be unreachable. I
will change `new_list` back to panic to avoid impact on client code.
--
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]