himadripal commented on code in PR #6905:
URL: https://github.com/apache/arrow-rs/pull/6905#discussion_r1892678912
##########
arrow-cast/src/cast/decimal.rs:
##########
@@ -359,15 +360,12 @@ where
.iter()
.map(|v| {
v.map(|v| {
- parse_string_to_decimal_native::<T>(v, scale as usize)
- .map_err(|_| {
- ArrowError::CastError(format!(
- "Cannot cast string '{}' to value of {:?}
type",
- v,
- T::DATA_TYPE,
- ))
- })
- .and_then(|v| T::validate_decimal_precision(v,
precision).map(|_| v))
+ parse_decimal::<T>(v, precision, scale).map_err(|_| {
+ ArrowError::CastError(format!(
+ "Cannot cast string '{}' to decimal type of
precision {} and scale {}",
Review Comment:
T:DATA_TYPE shows default Decimal(38,10) or Decimal256(76,..) in the error
message, hiding the precision and scale provided for cast.
--
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]