-
Notifications
You must be signed in to change notification settings - Fork 915
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
Enable type conversion from float to decimal type #7450
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-0.19 #7450 +/- ##
===============================================
+ Coverage 81.88% 82.32% +0.44%
===============================================
Files 101 101
Lines 16900 17283 +383
===============================================
+ Hits 13838 14229 +391
+ Misses 3062 3054 -8
Continue to review full report at Codecov.
|
) | ||
result = libcudf.unary.cast(self, dtype) | ||
if isinstance(dtype, cudf.core.dtypes.Decimal64Dtype): | ||
result.dtype.precision = dtype.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.
Why is it required to update precision in result ?
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.
The libcudf unary cast always returns a precision of 18 so it needs to be patched with the correct precision on the python side
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.
Yeah we are pretty much stuck with always patching the precision
attribute after getting a decimal column back from libcudf :(
When you said |
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.
Looks great to me! Approving with a request to add a TODO.
@gpucibot merge |
rerun tests |
@gpucibot merge |
This implements typecasting between `decimal` and `float` types. Addresses half of rapidsai#7440 Authors: - @ChrisJar Approvers: - Ram (Ramakrishna Prabhu) (@rgsl888prabhu) - Ashwin Srinath (@shwina) URL: rapidsai#7450
This implements typecasting between
decimal
andfloat
types.Addresses half of #7440