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 - incorrect field today/now shown in error #47860

Merged
merged 18 commits into from
Aug 15, 2022

Conversation

dannyi96
Copy link
Contributor

@dannyi96 dannyi96 commented Jul 26, 2022

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

  • Changes description

  • Example of changed error messages

    Code Old Error ( on 1.4.3 ) New Error
    pd.to_datetime(["today", "yesterday"]) dateutil.parser._parser.ParserError: Unknown string format: today dateutil.parser._parser.ParserError: Unknown string format: yesterday present at position 1

@dannyi96
Copy link
Contributor Author

dannyi96 commented Aug 8, 2022

hi @mroeschke, could you please review this change whenever possible ?
Above change does the trick, but not sure if anything else needs to be considered here ( in terms of other existing usecases, etc )
Thanks in advance

pandas/_libs/tslib.pyx Outdated Show resolved Hide resolved
@mroeschke mroeschke added Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas labels Aug 8, 2022
@dannyi96 dannyi96 marked this pull request as draft August 12, 2022 08:22
@dannyi96 dannyi96 marked this pull request as ready for review August 14, 2022 11:55
@mroeschke mroeschke added this to the 1.5 milestone Aug 15, 2022
@mroeschke mroeschke merged commit a6c9aa7 into pandas-dev:main Aug 15, 2022
@mroeschke
Copy link
Member

Thanks @dannyi96

@dannyi96 dannyi96 deleted the today_now_error branch August 15, 2022 17:24
YYYasin19 pushed a commit to YYYasin19/pandas that referenced this pull request Aug 23, 2022
… field today/now shown in error (pandas-dev#47860)

* Revert "addressing reviews CL#1"

This reverts commit 69dc2d4.

* Added improvements in to_datetime Error reporting message - incorrect field now/today shown as error

* Added improvements in to_datetime Error reporting message - incorrect field now/today shown as error

* added testcase

* adding position info & updated testcase

* precommit format changes

* addressing review comments

* addressing review comments

* addressing review comments

* addressing review comments

* addressing review comments pandas-dev#2

* addressing review comments
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
… field today/now shown in error (pandas-dev#47860)

* Revert "addressing reviews CL#1"

This reverts commit 69dc2d4.

* Added improvements in to_datetime Error reporting message - incorrect field now/today shown as error

* Added improvements in to_datetime Error reporting message - incorrect field now/today shown as error

* added testcase

* adding position info & updated testcase

* precommit format changes

* addressing review comments

* addressing review comments

* addressing review comments

* addressing review comments

* addressing review comments #2

* addressing review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: to_datetime ParserError on incorrect element
2 participants