Skip to content
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

Added improvements in to_datetime Error reporting message - Outofbounds error message #47849

Merged
merged 16 commits into from
Aug 1, 2022

Conversation

dannyi96
Copy link
Contributor

@dannyi96 dannyi96 commented Jul 25, 2022

Splitting changes from #47597, This PR aims to close the bug #46509

  • Changes description

  • Example of changed error messages

    Code Old Error ( on 1.4.3 ) New Error
    pd.to_datetime(pd.Series(["11:00", "12:00", "11:0"])) pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-01 11:00:00 pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-01 11:00:00 present at position 2
    pd.to_datetime(['11:0']) pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-01 11:00:00 pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-01 11:00:00 present at position 0
    pd.to_datetime('11:0') pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-01 11:00:00 pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-01 11:00:00 present at position 0

@pep8speaks
Copy link

pep8speaks commented Jul 25, 2022

Hello @dannyi96! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-08-01 16:04:48 UTC

@dannyi96 dannyi96 marked this pull request as draft July 25, 2022 20:17
@dannyi96 dannyi96 marked this pull request as ready for review July 26, 2022 10:36
pandas/_libs/tslib.pyx Outdated Show resolved Hide resolved
@mroeschke mroeschke added Error Reporting Incorrect or improved errors from pandas Timestamp pd.Timestamp and associated methods labels Jul 26, 2022
pandas/_libs/tslib.pyx Outdated Show resolved Hide resolved
@dannyi96 dannyi96 marked this pull request as draft July 28, 2022 14:17
@dannyi96 dannyi96 marked this pull request as ready for review July 30, 2022 18:55
@mroeschke mroeschke added this to the 1.5 milestone Aug 1, 2022
@mroeschke mroeschke merged commit 0fdad4e into pandas-dev:main Aug 1, 2022
@mroeschke
Copy link
Member

Thanks @dannyi96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Timestamp pd.Timestamp and associated methods
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants