Skip to content

ERR: better error message on unparseable datetimes #31118

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
wants to merge 4 commits into from
Closed

ERR: better error message on unparseable datetimes #31118

wants to merge 4 commits into from

Conversation

baevpetr
Copy link
Contributor

@baevpetr baevpetr commented Jan 18, 2020

Signed-off-by: baevpetr <[email protected]>
@pep8speaks
Copy link

pep8speaks commented Jan 18, 2020

Hello @baevpetr! 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 2020-01-21 11:51:47 UTC

Signed-off-by: baevpetr <[email protected]>
Signed-off-by: baevpetr <[email protected]>
@baevpetr
Copy link
Contributor Author

So, Linux py36_minimum_versions & macOS py36_macos builds do not pass the test:
their exceptions don't seem to contain the passing date.

@simonjayhawkins
Copy link
Member

@baevpetr can you continue pushing to #30711 instead of opening a new PR.

@simonjayhawkins simonjayhawkins added the Duplicate Report Duplicate issue or pull request label Jan 18, 2020
@baevpetr
Copy link
Contributor Author

@simonjayhawkins, no, I can't. Sorry.
image

@simonjayhawkins
Copy link
Member

If you now unable to reinstate the original repository, then you should put a note in the original PR to make the reviewers of the original PR aware. To help maintain the history, should also update the OP to reference the previous PR.

@simonjayhawkins simonjayhawkins added Error Reporting Incorrect or improved errors from pandas Timedelta Timedelta data type Datetime Datetime data dtype and removed Duplicate Report Duplicate issue or pull request labels Jan 18, 2020
# GH#10720
date = "Month 1, 1999"
expected_args = (
f"Unknown string format: %s {date}. "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that the error is here, can you remove the %s?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks likely

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AssertionError: Pattern "Unknown string format: %s Month 1, 1999. You can coerce to NaT by passing errors='coerce'" not found in "Unknown string format. You can coerce to NaT by passing errors='coerce'"
That is output from tests on Linux py36_minimum_versions & macOS py36_macos. There's no date at all. On other platforms test passes.

def test_to_datetime_unparseable_raise(self):
# GH#10720
date = "Month 1, 1999"
expected_args = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call this msg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@@ -110,6 +110,16 @@ def test_to_timedelta_invalid(self):
invalid_data, to_timedelta(invalid_data, errors="ignore")
)

# GH#10720
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make a new test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timedeltas passes normally. What logic should I test? (for now moved that test to other tests with 'coerce').

@jreback jreback added this to the 1.1 milestone Jan 20, 2020
@jreback jreback changed the title err message workaround ERR: better error message on unparseable datetimes Jan 20, 2020
@baevpetr
Copy link
Contributor Author

baevpetr commented Jan 21, 2020

And suddenly pip-20 problems with installation in CI...
Was released several hours ago.

Signed-off-by: baevpetr <[email protected]>
@WillAyd
Copy link
Member

WillAyd commented Feb 12, 2020

@baevpetr is this still active? Can you try to get CI green?

@WillAyd
Copy link
Member

WillAyd commented Mar 14, 2020

Closing as stale but ping if you'd like to pick back up

@WillAyd WillAyd closed this Mar 14, 2020
@ShaharNaveh ShaharNaveh mentioned this pull request Mar 18, 2020
5 tasks
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 Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC/ERR: better error message on unsuccessful datetime parsing
7 participants