-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Decimal] Add scale argument to validation functions to ensure accurate error logging #8396
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
Conversation
81f5411 to
3b3c6b0
Compare
… precision checks
3b3c6b0 to
e87504e
Compare
ed8cd9b to
4e6a05e
Compare
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Weijun-H -- this looks like a very nice usability improvement to me
|
|
||
| /// Validates that `value` contains no more than `precision` decimal digits | ||
| fn validate_decimal_precision(value: Self::Native, precision: u8) -> Result<(), ArrowError>; | ||
| fn validate_decimal_precision( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is technically a breaking API change as it adds new functions. However, I think it is reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you potentially add a new function with the new signature and deprecate the old one to ease upgrades?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I re-reviewed this and I think I missed it was a trait method (and we had some bad luck trying to deprecate traits) -- the compiler doesn't seem to complain if you implement a deprecated trait 🤔
Maybe we should just keep it the way you original had it? If you agree I can revert the cahnge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the churn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worry, I reverted the change
3107320 to
307a217
Compare
|
Thanks again @Weijun-H |
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?