Skip to content
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

[Java] Added a few more tests for Decimal to String cast #9818

Merged
merged 2 commits into from
Dec 3, 2021

Conversation

razajafri
Copy link
Contributor

This PR adds a few more edge cases as a sanity test on the request of @sameerz

@razajafri razajafri requested a review from a team as a code owner December 2, 2021 01:57
@razajafri razajafri self-assigned this Dec 2, 2021
@github-actions github-actions bot added the Java Affects Java cuDF API. label Dec 2, 2021
@@ -3376,16 +3376,27 @@ void testFixedWidthCast() {
void testCastBigDecimalToString() {
BigDecimal[] bigValues = {new BigDecimal("923121331938210123.321"),
new BigDecimal("9223372036854775808.191"),
new BigDecimal("-9.223"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test case for a negative decimal value greater than 64 bits?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing that will accomplish is to verify that Java BigDecimals > 64 bit have precision > 38

@razajafri razajafri added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 2, 2021
@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #9818 (3d8b603) into branch-22.02 (967a333) will decrease coverage by 0.04%.
The diff coverage is 5.79%.

❗ Current head 3d8b603 differs from pull request most recent head 9ee78b6. Consider uploading reports for the commit 9ee78b6 to get more accurate results
Impacted file tree graph

@@               Coverage Diff                @@
##           branch-22.02    #9818      +/-   ##
================================================
- Coverage         10.49%   10.44%   -0.05%     
================================================
  Files               119      119              
  Lines             20305    20419     +114     
================================================
+ Hits               2130     2133       +3     
- Misses            18175    18286     +111     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/_base_index.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/column.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/string.py 0.00% <ø> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/groupby/groupby.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/index.py 0.00% <ø> (ø)
python/cudf/cudf/core/indexed_frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/multiindex.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/json.py 0.00% <ø> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5491cc7...9ee78b6. Read the comment docs.


BigDecimal[] bigValues0 = {new BigDecimal("992983283728193827182918744829283742232")};
try {
ColumnVector cv = ColumnVector.fromDecimals(bigValues0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make sure that this didn't leak?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously we should!

@razajafri
Copy link
Contributor Author

rerun tests

Comment on lines +3397 to +3399
if (cv != null) {
cv.close();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not try(....cv = ..) {}? It is auto-closed, isn't it?

@razajafri
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 62103c6 into rapidsai:branch-22.02 Dec 3, 2021
@razajafri razajafri deleted the CUDF-more-tests branch December 3, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants