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

Expose a Decimal32Dtype in cuDF Python #8438

Merged
merged 25 commits into from
Jun 29, 2021

Conversation

skirui-source
Copy link
Contributor

@skirui-source skirui-source commented Jun 3, 2021

Fixes: #8218

Similarly to libcudf's 64-bit decimal type, this PR exposes the Decimal32Dtype and its corresponding Decimal32Column type. Following this implementation, user can create a series or dataframe with decimal32 dtype.
Note: Only to_arrow and from_arrow methods are currently being supported.

Example:

>>> import cudf
>>> s = cudf.Series([1,2,3,4], dtype=cudf.Decimal32Dtype(precision=8, scale=2))
>>> s
0    1.00
1    2.00
2    3.00
3    4.00
dtype: decimal32

@skirui-source skirui-source added feature request New feature or request Python Affects Python cuDF API. labels Jun 3, 2021
@skirui-source skirui-source self-assigned this Jun 3, 2021
@skirui-source skirui-source marked this pull request as ready for review June 17, 2021 01:13
@skirui-source skirui-source requested a review from a team as a code owner June 17, 2021 01:13
@skirui-source skirui-source added the breaking Breaking change label Jun 17, 2021
Copy link
Contributor

@isVoid isVoid left a comment

Choose a reason for hiding this comment

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

Mostly looks good aside one small question. Great job!

python/cudf/cudf/tests/test_decimal.py Show resolved Hide resolved
Copy link
Member

@charlesbluca charlesbluca left a comment

Choose a reason for hiding this comment

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

Looks great 🙂 just one small question

python/cudf/cudf/core/column/column.py Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.08@ea82bf4). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 2b8e20d differs from pull request most recent head 62ad755. Consider uploading reports for the commit 62ad755 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.08    #8438   +/-   ##
===============================================
  Coverage                ?   82.95%           
===============================================
  Files                   ?      109           
  Lines                   ?    18331           
  Branches                ?        0           
===============================================
  Hits                    ?    15206           
  Misses                  ?     3125           
  Partials                ?        0           

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 ea82bf4...62ad755. Read the comment docs.

Copy link
Contributor

@isVoid isVoid left a comment

Choose a reason for hiding this comment

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

lgtm code wise. Great job!

Can you also update this page to include the new datatype? https://docs.rapids.ai/api/cudf/stable/basics.html

@skirui-source
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 2d9fd5f into rapidsai:branch-21.08 Jun 29, 2021
@skirui-source skirui-source deleted the decimal32 branch October 19, 2021 20:07
@vyasr vyasr mentioned this pull request Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change feature request New feature or request Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Expose a Decimal32Dtype in cuDF Python
4 participants