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

ENH: Downsampling pyarrow backed DatetimeIndex should potentially return date32 instead of timestamp #58308

Open
1 of 3 tasks
WillAyd opened this issue Apr 18, 2024 · 4 comments
Labels

Comments

@WillAyd
Copy link
Member

WillAyd commented Apr 18, 2024

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

In [30]: pd.Series(
    ...:     range(3),
    ...:     index=pd.Index([
    ...:         "2024-01-01 00:00:00",
    ...:         "2024-01-01 12:00:00",
    ...:         "2024-01-02 00:00:00"
    ...:     ], dtype=pd.ArrowDtype(pa.timestamp("s")))
    ...: ).resample("D").asfreq().index.dtype
Out[30]: timestamp[s][pyarrow]

Feature Description

When downsampling to a resolution of day or lower, I think .resample should return a pyarrow date type

Alternative Solutions

status quo

Additional Context

No response

@WillAyd WillAyd added Enhancement Timeseries Arrow pyarrow functionality labels Apr 18, 2024
@jbrockmendel
Copy link
Member

why? im wary of any silent dtype-changing, which we're moving away from elsewhere

@WillAyd
Copy link
Member Author

WillAyd commented Apr 18, 2024

I think resampling to days declares the intent of working with dates and not timestamps

@mroeschke
Copy link
Member

If a user were to resample by even a lower resolution (e.g. W, ME), would you also expect date32 type?

@WillAyd
Copy link
Member Author

WillAyd commented Apr 18, 2024

Yes - anything date or lower I would expect a date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants