-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: [Variant] Add Validation for Variant Deciaml #7738
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
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.
Thanks @Weijun-H -- this looks like a great start. I left some suggestions -- let me know what you think
|
@scovich and @friendlymatthew perhaps you have some time to review this PR as well |
681e4f1 to
5826ca6
Compare
5826ca6 to
2ed858b
Compare
ca8b76e to
e71f52f
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 great to me
I am going to merge this one in so we minimize conflicts with @friendlymatthew 's PR
|
I made a small follow on PR as well |
…ing tests (#7776) # Which issue does this PR close? * Relates to #7697 * Part of #6736 # Rationale for this change As a follow-up to #7738, we should verify that the unscaled integer value fits in the max precision (scale factor was already validated). # What changes are included in this PR? Add the missing checking, and add missing unit tests for both precision and scale. Also move the `VariantDecimalXX` structs to their own mod. # Are these changes tested? Yes, see above. # Are there any user-facing changes? No. Public re-rexport of the moved structs. Co-authored-by: Andrew Lamb <[email protected]>
…es (#7770) # Which issue does this PR close? We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. - part of #6736 # Rationale for this change I noticed this while reviewing @Weijun-H's PR - #7738 I didn't know what part of the crate were using the fields directly and thus what part could potentially be creating invalid variants. By making the fields non `pub(crate)` I think it makes it clear these can not be constructed invalidly This also gave me a good excuse to write some more examples # What changes are included in this PR? 1. make fields in `VariantDecimal*` private 2. Add doc examples examples # Are these changes tested? By CI # Are there any user-facing changes? API change in a non-published crate, so no end user impact yet
Which issue does this PR close?
VariantBuilder#7697Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?