Skip to content

Conversation

george-adams1
Copy link

@george-adams1 george-adams1 commented Aug 24, 2025

Fixes #57948

Summary

ArrowDtype.itemsize was incorrectly returning 8 bytes for date32[day] and other fixed-width PyArrow types because it always fell back to numpy_dtype.itemsize. This PR uses PyArrow's bit_width for fixed-width types and gracefully falls back to numpy for variable-width types.

Changes

  • Modified ArrowDtype.itemsize to use pyarrow_dtype.bit_width when available
  • Added comprehensive regression test covering the fix

Example

Before: ArrowDtype(pa.date32()).itemsize == 8
After: ArrowDtype(pa.date32()).itemsize == 4

@jbrockmendel
Copy link
Member

Can you get the CI passing

@george-adams1
Copy link
Author

Yup. I will work on this tomorrow.

@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: itemsize wrong for date32[day][pyarrow] dtype?

3 participants