Skip to content

ENH: Add dtype_backend parameter to to_datetime #53952

Open
@wirable23

Description

@wirable23

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

>>> a = pd.Series([4194304], dtype="int64[pyarrow]")
>>> pd.to_datetime(a).dtype
dtype('<M8[ns]')
>>>

In the above example, passing in a pyarrow backed series to to_datetime returns a numpy backed series, in to_numeric, there's a dtype_backend parameter that allows preserving of pyarrow dtypes, it would be nice to have the same option in to_datetime.

Feature Description

Same way as in to_numeric, adding a dtype_backend parameter.

Alternative Solutions

N/A

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions