Pandas version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pandas.

  • [X] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

df = pd.DataFrame({"date": ['2022-01-01', '2023-01-01']}).astype({"date": "datetime64[ns]"})
print(df.date.diff())


df = pd.DataFrame({"date": ['2022-01-01', '2023-01-01']}).astype({"date": "datetime64[s]"})
print(df.date.diff())

Issue Description

I'm expecting the difference to be 365 days on both, however on the second example the difference ends up coming in nanoseconds as opposed to seconds.

Expected Behavior

Expecting the diff to be 365 days on both

Installed Versions

Replace this line with the output of pd.show_versions()

Comment From: asishm

Thanks for the report. Can you show the output you are currently seeing (and also provide the installed versions in the section)?

On main and latest version 2.2.2, I get

0        NaT
1   365 days
Name: date, dtype: timedelta64[ns]
0        NaT
1   365 days
Name: date, dtype: timedelta64[s]

Comment From: mroeschke

Closing as working on main