Skip to content

Conversation

jbrockmendel
Copy link
Member

if pa.types.is_null(arr.type):
if lib.infer_dtype(values) == "decimal":
# GH#62522; the specific decimal precision here is arbitrary
arr = arr.cast(pa.decimal32(1))
Copy link
Member

Choose a reason for hiding this comment

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

While it would be nice to use a smaller 32 bit-width here, this API is only available in PyArrow 19 (evident by the xfail). I think we'll need to use decimal128 for our version compatibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea, updated

@mroeschke mroeschke added the Arrow pyarrow functionality label Oct 16, 2025
@mroeschke mroeschke added this to the 3.0 milestone Oct 16, 2025
@mroeschke mroeschke merged commit 79eb377 into pandas-dev:main Oct 16, 2025
47 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the bug-decimal branch October 16, 2025 21:15
eicchen pushed a commit to eicchen/pandas that referenced this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arrow pyarrow functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: ArrowEA._cast_pointwise_result([Decimal(NaN)])

2 participants