2010YOUY01 commented on code in PR #18790:
URL: https://github.com/apache/datafusion/pull/18790#discussion_r2536222032
##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -1729,14 +1714,15 @@ impl ScalarValue {
DataType::Float32 => ScalarValue::Float32(Some(10.0)),
DataType::Float64 => ScalarValue::Float64(Some(10.0)),
DataType::Decimal32(precision, scale) => {
- if let Err(err) =
validate_decimal_precision_and_scale::<Decimal32Type>(
+ let validation =
validate_decimal_precision_and_scale::<Decimal32Type>(
*precision, *scale,
- ) {
- return _internal_err!("Invalid precision and scale {err}");
- }
- if *scale < 0 {
- return _internal_err!("Negative scale is not supported");
- }
+ );
+ assert_or_internal_err!(
+ validation.is_ok(),
+ "Invalid precision and scale {}",
+ validation.unwrap_err()
+ );
Review Comment:
Good point. Updated in
[09c15ee](https://github.com/apache/datafusion/pull/18790/commits/09c15ee1f60c8b6accb722c2d75fdf7e36aa9279)
--
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]