Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check precision overflow for casting floating to decimal #4866

Merged

Conversation

viirya
Copy link
Member

@viirya viirya commented Sep 27, 2023

Which issue does this PR close?

Closes #4865.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Sep 27, 2023
@@ -398,21 +410,31 @@ where

if cast_options.safe {
array
.unary_opt::<_, Decimal256Type>(|v| i256::from_f64((v.as_() * mul).round()))
.unary_opt::<_, Decimal256Type>(|v| {
i256::from_f64((v.as_() * mul).round()).and_then(|v| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be filter

@tustvold tustvold merged commit 62bb64c into apache:master Sep 27, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check precision overflow for casting floating to decimal
2 participants