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

GH-44713: [Python] Add support for Decimal32 and Decimal64 types #44882

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Nov 28, 2024

Rationale for this change

Arrow C++ and the Arrow specification now support 32-bit and 64-bit decimal types...pyarrow should too!

What changes are included in this PR?

Added type, array, and scalar bindings.

Are these changes tested?

Working on it!

Are there any user-facing changes?

Yes! (Working on completing documentation)

Copy link

⚠️ GitHub issue #44713 has been automatically assigned in GitHub to PR creator.

@ianmcook
Copy link
Member

ianmcook commented Nov 29, 2024

Please add the concrete classes for the scalars to the list under the Scalars heading in arrays.rst.

And after you add the is_ methods, please add those under the Type Checking heading in datatypes.rst.

Thanks!

@paleolimbot
Copy link
Member Author

Current battles (so I remember them Monday!):

I'm missing some member definition for the use-facing type classes:

import pyarrow as pa

pa.decimal128(2, 0).precision
#> 2
pa.decimal256(2, 0).precision
#> 2
pa.decimal32(2, 0).precision
#> AttributeError: 'pyarrow.lib.Decimal32Type' object has no attribute 'precision'

There's no cast implemented from "float" to "decimal32/64", which at least some of the tests depend on:

pyarrow.lib.ArrowNotImplementedError: Unsupported cast to decimal32(7, -8) from float

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants