Skip to content

BUG: nanoseconds argument for DateOffset results in wrong output #36589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GYHHAHA opened this issue Sep 24, 2020 · 4 comments
Closed

BUG: nanoseconds argument for DateOffset results in wrong output #36589

GYHHAHA opened this issue Sep 24, 2020 · 4 comments
Labels
Bug Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas Frequency DateOffsets
Milestone

Comments

@GYHHAHA
Copy link
Contributor

GYHHAHA commented Sep 24, 2020

>>>ts = pd.Timestamp('2020-1-1')
>>>ts + pd.DateOffset(nanoseconds=1000)
Timestamp('2020-01-02 00:00:00')

This is related to offset = timedelta(1) in _determine_offset from pd._libs.tslibs.offsets.

@GYHHAHA GYHHAHA added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 24, 2020
@phofl
Copy link
Member

phofl commented Sep 24, 2020

Thanks for your report.

Should we raise in _determine_offset if the only item in kwds is nanoseconds/s?

@GYHHAHA
Copy link
Contributor Author

GYHHAHA commented Sep 24, 2020

Yes I think so. Users can use nano in Timedelta to handle this instead of DateOffset.

Should I open a PR? I'm not sure if other developers have other opinion.

@dsaxton dsaxton added Datetime Datetime data dtype and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 25, 2020
@jbrockmendel jbrockmendel added the Frequency DateOffsets label Oct 1, 2020
@mroeschke mroeschke added the Error Reporting Incorrect or improved errors from pandas label Aug 13, 2021
@jbrockmendel
Copy link
Member

@tushushu i think this was closed by #43968. can you confirm?

@jbrockmendel jbrockmendel added the Closing Candidate May be closeable, needs more eyeballs label Dec 21, 2021
@tushushu
Copy link
Contributor

@tushushu i think this was closed by #43968. can you confirm?

Yes, confirmed with that.

@jbrockmendel jbrockmendel removed the Closing Candidate May be closeable, needs more eyeballs label Dec 22, 2021
@simonjayhawkins simonjayhawkins added this to the 1.4 milestone Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas Frequency DateOffsets
Projects
None yet
Development

No branches or pull requests

7 participants