Skip to content

BUG: TimedeltaArray.astype(duration[{unit}][pyarrow]) #49795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 22, 2022

Conversation

lukemanley
Copy link
Member

@lukemanley lukemanley commented Nov 20, 2022

Fixes the following:

import pandas as pd

arr = pd.array([pd.Timedelta(days=1)]) 
arr.astype("duration[ns][pyarrow]")     # <- raises

TypeError: Cannot convert ArrowDtype to numpy.dtype

@lukemanley lukemanley added Bug Dtype Conversions Unexpected or buggy dtype conversions Timedelta Timedelta data type Arrow pyarrow functionality labels Nov 20, 2022
@mroeschke mroeschke added this to the 2.0 milestone Nov 22, 2022
@mroeschke mroeschke merged commit 7d7c818 into pandas-dev:main Nov 22, 2022
@mroeschke
Copy link
Member

Thanks @lukemanley

mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
@lukemanley lukemanley deleted the timedelta-to-pyarrow branch December 20, 2022 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Bug Dtype Conversions Unexpected or buggy dtype conversions Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants