tmi commented on code in PR #10899:
URL: https://github.com/apache/datafusion/pull/10899#discussion_r1638403937
##########
datafusion/functions/src/math/round.rs:
##########
@@ -109,6 +109,9 @@ pub fn round(args: &[ArrayRef]) -> Result<ArrayRef> {
if args.len() == 2 {
decimal_places = ColumnarValue::Array(args[1].clone());
+ // if cast fails, we return error instead of panic. Better solution
would to update
+ // function signature and instead error during planning -- to be
improved later
+ _ = decimal_places.cast_to(&Int32, None)?;
Review Comment:
right, thx 😇 Removed & updated tests match; all seems to behave well
--
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]