Skip to content
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

BUG: Assigning datetime to pa.date32() type array should raise #58420

Open
3 tasks done
WillAyd opened this issue Apr 25, 2024 · 0 comments
Open
3 tasks done

BUG: Assigning datetime to pa.date32() type array should raise #58420

WillAyd opened this issue Apr 25, 2024 · 0 comments
Labels
Arrow pyarrow functionality Bug Timeseries

Comments

@WillAyd
Copy link
Member

WillAyd commented Apr 25, 2024

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import pyarrow as pa

pa_arr = pa.array([
    datetime.date(2024, 1, 1),
    datetime.date(2024, 1, 2),
    datetime.date(2024, 1, 3),
])
ser = pd.Series(pa_arr, dtype=pd.ArrowDtype(pa.date32()))
ser.iloc[0] =  datetime.datetime(2024, 12, 31, 12, 20, 0)

Issue Description

Assigning a datetime value to a pyarrow date array type seems to implicitly drop the time components

Expected Behavior

Should raise TypeError

Installed Versions

In [24]: pd.version
Out[24]: '3.0.0.dev0+681.g434fda08cf'

In [25]: pa.version
Out[25]: '15.0.0'

@WillAyd WillAyd added Bug Timeseries Arrow pyarrow functionality labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Bug Timeseries
Projects
None yet
Development

No branches or pull requests

1 participant