Skip to content

ENH: Allow Arrow types directly with pd.to_datetime #58220

Open
@WillAyd

Description

@WillAyd

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

When users just want dates, the first thing they might try is:

ser = pd.Series(["2024-01-01", "2024-01-02"])
pd.to_datetime(ser).dt.date

But that unfortunately returns dtype=object

An arguably better approach would be something like

pd.to_datetime(ser).astype(pd.ArrowDtype(pa.date32()))

But has the disadvantage of taking an extra step to get the desired type

Feature Description

Should we add an arrow backend/family argument to pd.to_datetime? Alternately maybe we need to introduce a new pd.to_date function? @jbrockmendel curious what you might think

Alternative Solutions

n/a

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions