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"

Comment From: rhshadrach

What if we made unit apply to non-numeric arguments? I.e. if a non-numeric argument is provided we convert to the user-specified unit? This would allow us to avoid code churn.

Comment From: jbrockmendel

What if we made unit apply to non-numeric arguments? I.e. if a non-numeric argument is provided we convert to the user-specified unit? This would allow us to avoid code churn.

Do you mean "interpret 'unit' as specifying the desired output-unit in some cases but not atll"? i think im against more-overloading like that

Comment From: rhshadrach

I was proposing to have it be all, but I think I now see this issue. If someone supplies e.g. 0.5772156649 and specifies unit=ms, they likely do not want the output to be ms.

I see your numeric_unit and raise you an input_unit that would raise whenever specified and the input is not numeric.