-
Notifications
You must be signed in to change notification settings - Fork 327
Use Rounding_Mode
instead of use_bankers
flag
#12641
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
@@ -47,7 +47,7 @@ | |||
- floor self -> Standard.Base.Data.Numbers.Integer | |||
- negate self -> Standard.Base.Data.Numbers.Integer | |||
- parse text:Standard.Base.Data.Text.Text radix:Standard.Base.Data.Numbers.Integer= -> Standard.Base.Any.Any | |||
- round self decimal_places:Standard.Base.Data.Numbers.Integer= rounding_mode:Standard.Base.Data.Numeric.Rounding_Mode.Rounding_Mode= -> Standard.Base.Any.Any | |||
- round self decimal_places:Standard.Base.Data.Numbers.Integer= rounding_mode:(Standard.Base.Data.Numeric.Rounding_Mode.Rounding_Mode|Standard.Base.Data.Boolean.Boolean)= -> Standard.Base.Any.Any |
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.
- Why there is no return type specification?
- at least I guess missing
-> Number
is the reason why the return type isAny
- specifying more narrow return type should help static analysis
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.
Done
@@ -3,4 +3,4 @@ | |||
- type Rounding_Mode | |||
- Bankers | |||
- Half_Up | |||
- to_java_rounding_mode self -> Standard.Base.Data.Numeric.Rounding_Mode.RoundingMode | |||
- resolve_deprecated_rounding_mode type_name:Standard.Base.Data.Text.Text rounding_mode:(Standard.Base.Data.Numeric.Rounding_Mode.Rounding_Mode|Standard.Base.Data.Boolean.Boolean) ~action:Standard.Base.Any.Any -> Standard.Base.Any.Any |
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.
Why is this function visible to public at all?
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 removed now.
## PRIVATE | ||
Convert deprecated `use_bankers : Boolean` arguments (passed as | ||
`rounding_mode`) to `Rounding_Mode`. | ||
resolve_deprecated_rounding_mode (type_name:Text) (rounding_mode : Rounding_Mode | Boolean) ~action = |
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.
resolve_deprecated_rounding_mode (type_name:Text) (rounding_mode : Rounding_Mode | Boolean) ~action = | |
private resolve_deprecated_rounding_mode (type_name:Text) (rounding_mode : Rounding_Mode | Boolean) ~action = |
@@ -1,3 +1,6 @@ | |||
from Standard.Base import all |
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 too wide import, @GregoryTravis
- usually explicit
import project.
are used to import modules from the same project - causes problems for PoC: Getting
Any
,Text
& numbers closure down to 35 modules #12819 - can you replace it with explicit imports?
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.
Replace the
use_bankers
flag with the more flexible and user-friendlyRounding_Mode
value. This will allow additional rounding modes to be added in the future, rather than adding additional argument flags for each feature.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.