Skip to content

DEPR: rename 'unit' keyword in to_datetime etc #62097

@jbrockmendel

Description

@jbrockmendel

to_datetime, to_timedelta, Timestamp, and Timedelta have a unit keyword that causes confusion because the term 'unit' is overloaded. The keyword refers to how we interpret integer arguments, while the result's obj.unit attribute refers to the resolution of the result. Confusion e.g. #60371.

Update: also the meaning of the keyword in date_range matches the attribute but not the to_datetime meaning.

Let's deprecate the argument and rename it to something else. Opening bid: "numeric_unit"

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions