Open MarcoGorelli opened 6 months ago
Not sure what to do here, as there isn't a numpy dtype corresponding to date32
I think it's OK to override ArrowDtype.itemsize
to handle this case separately
PyArrow data types of fixed width have a bit_width
attribute that could be used here. That does raise for nested types, though at the moment we just return 8 from the numpy object dtype, which also doesn't necessarily makes sense.
In [13]: pd.ArrowDtype(pa.list_(pa.int32())).itemsize
Out[13]: 8
take
take
I'm having a hard time trying to find what and where to find the relationship between numpy_dtype and the itemsize method. Going to the definition of itemsize method does not show an implementation of the method, so I'm not sure what it is doing.
pandas/pandas/core/dtypes/dtypes.py#L2213-L2216
Any help is appreciated
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
I think it should show
4
?pa.date32()
is 32 bits, so 4 bytesExpected Behavior
pd.ArrowDtype(pa.date32()).itemsize # 4
Installed Versions