-
Notifications
You must be signed in to change notification settings - Fork 908
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
Add Python DecimalColumn #6715
Add Python DecimalColumn #6715
Conversation
Please update the changelog in order to start CI tests. View the gpuCI docs here. |
Codecov Report
@@ Coverage Diff @@
## branch-0.18 #6715 +/- ##
===============================================
+ Coverage 82.09% 82.22% +0.12%
===============================================
Files 97 98 +1
Lines 16474 16655 +181
===============================================
+ Hits 13524 13694 +170
- Misses 2950 2961 +11
Continue to review full report at Codecov.
|
This PR needs a description, and a decision on whether to retarget to 0.18. |
We plan to have this ready for review before code freeze (EOD today). |
…dd-decimal-column-python
…to add-decimal-column-python
…dd-decimal-column-python
…dd-decimal-column-python
…/cudf into add-decimal-column-python
…dd-decimal-column-python
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.
cpp approval.
Update Copyright year.
@shwina @kkraus14 CNL's behavior is that it can't represent numbers outside the bounds of the underlying type regrardless of what the positive scale (negative scale for Python) is. CNL also has a libcudf on the other hand actually does work with values greater than the bounds of the underlying type, as long as you construct from the already shifted values (which is what using fp_wrapper = cudf::test::fixed_point_column_wrapper<int32_t>;
auto const a = fp_wrapper{{100000000}, scale_type{6}};
auto const b = fp_wrapper{{5000000}, scale_type{7}};
auto const c = fp_wrapper{{2}, scale_type{0}};
auto const expected1 = fp_wrapper{{150000000}, scale_type{6}};
auto const expected2 = fp_wrapper{{50000000}, scale_type{6}};
auto const result1 = cudf::binary_operation(a, b, cudf::binary_operator::ADD, {});
auto const result2 = cudf::binary_operation(a, c, cudf::binary_operator::DIV, {});
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected1, result1->view());
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected2, result2->view()); Update: using fp_wrapper = cudf::test::fixed_point_column_wrapper<int64_t>;
auto a = fp_wrapper{{100000000}, scale_type{100}};
auto b = fp_wrapper{{5000000}, scale_type{101}};
auto c = fp_wrapper{{2}, scale_type{0}};
auto expected1 = fp_wrapper{{150000000}, scale_type{100}};
auto expected2 = fp_wrapper{{50000000}, scale_type{100}};
auto result1 = cudf::binary_operation(a, b, cudf::binary_operator::ADD, {});
auto result2 = cudf::binary_operation(a, c, cudf::binary_operator::DIV, {});
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected1, result1->view());
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected2, result2->view()); |
@@ -2200,6 +2200,21 @@ TYPED_TEST(FixedPointTestBothReps, FixedPointBinaryOpMultiplyScalar) | |||
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, result->view()); | |||
} | |||
|
|||
TYPED_TEST(FixedPointTestBothReps, FixedPointBinaryOpSimplePlus) |
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.
Is this just a missing binop test? I can't tell if it's testing something more specific/related to this PR.
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.
cc: @codereport; IIRC it's just a test we wrote because this case wasn't working in Python. Eventually, we traced that to a Python bug, but we decided to keep this test because why would you delete a test? :D
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.
Any test that ever failed is a good test 👍
I asked just to make sure it covers what it's supposed to.
@gpucibot merge |
Resolves #6657.