Skip to content

Conversation

@mraabhijit
Copy link
Contributor

@mraabhijit mraabhijit commented Oct 11, 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 and booleans.

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

@mraabhijit mraabhijit closed this Oct 11, 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?

1 participant