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

[REVIEW] Fix error in cudf.to_numeric when a bool input is passed #10431

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

galipremsagar
Copy link
Contributor

@galipremsagar galipremsagar commented Mar 14, 2022

Fixes: #10049

This PR fixes an incorrect error being displayed when cudf.to_numeric is called by passing an input with bool dtype. Technically bool is the lowest dtype size possible in numpy so this is a no-op because to_numeric is aimed at downcasting inputs.

@galipremsagar galipremsagar added bug Something isn't working Python Affects Python cuDF API. 4 - Needs cuDF (Python) Reviewer non-breaking Non-breaking change labels Mar 14, 2022
@galipremsagar galipremsagar requested a review from a team as a code owner March 14, 2022 21:00
@galipremsagar galipremsagar self-assigned this Mar 14, 2022
@galipremsagar galipremsagar requested review from vyasr and shwina March 14, 2022 21:00
@codecov
Copy link

codecov bot commented Mar 14, 2022

Codecov Report

Merging #10431 (c4d8503) into branch-22.04 (4596244) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@               Coverage Diff                @@
##           branch-22.04   #10431      +/-   ##
================================================
+ Coverage         86.13%   86.16%   +0.02%     
================================================
  Files               139      139              
  Lines             22438    22439       +1     
================================================
+ Hits              19328    19334       +6     
+ Misses             3110     3105       -5     
Impacted Files Coverage Δ
python/cudf/cudf/core/tools/numeric.py 89.24% <100.00%> (+0.11%) ⬆️
python/cudf/cudf/core/column/string.py 88.39% <0.00%> (+0.12%) ⬆️
python/cudf/cudf/core/groupby/groupby.py 91.57% <0.00%> (+0.22%) ⬆️
python/cudf/cudf/core/column/numerical.py 95.28% <0.00%> (+0.29%) ⬆️
python/cudf/cudf/core/tools/datetimes.py 84.49% <0.00%> (+0.30%) ⬆️
python/cudf/cudf/core/column/lists.py 90.56% <0.00%> (+0.47%) ⬆️

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 4596244...c4d8503. Read the comment docs.

python/cudf/cudf/core/tools/numeric.py Outdated Show resolved Hide resolved
@galipremsagar galipremsagar requested a review from vyasr March 15, 2022 14:36
Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

This looks much cleaner. It does mean reconstructing the list any time cudf.to_numeric is called with downcast=True, but I'm fine with that.

@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 4 - Needs cuDF (Python) Reviewer labels Mar 15, 2022
@galipremsagar
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit deb39db into rapidsai:branch-22.04 Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Error casting Bool series to Float
2 participants