Conversation

lukemanley

ArrowDtype.numpy_dtype goes through the pyarrow to_pandas_type method which was added before pandas supported non-nano units. This PR ensures the correct units are passed along to the numpy dtype. This fixes 6 xfails.

pyarrow already preserves the units when going directly from pyarrow to numpy:

>>> import pyarrow as pa
>>> arr = pa.array([1, 2, 3], type=pa.duration("us"))
>>> arr.to_numpy()
array([1, 2, 3], dtype='timedelta64[us]')

@lukemanleylukemanley added Bug Arrowpyarrow functionalityNon-Nanodatetime64/timedelta64 with non-nanosecond resolutionlabels Mar 5, 2023
@mroeschkemroeschke added this to the 2.1 milestone Mar 6, 2023
@jbrockmendeljbrockmendel merged commit fa01870 into pandas-dev:main Mar 6, 2023
@jbrockmendel

thanks @lukemanley

Sign up for free to join this conversation on . Already have an account? Sign in to comment
Arrowpyarrow functionalityBug Non-Nanodatetime64/timedelta64 with non-nanosecond resolution
None yet

Successfully merging this pull request may close these issues.