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

TST/BUG: Improve error handling when parsing iso 8601 strings #8910

Closed
broessli opened this issue Nov 27, 2014 · 1 comment

Comments

Projects
None yet
3 participants
@broessli
Copy link

commented Nov 27, 2014

xref #8832

Parsing of datetime strings ending with Z0or Z00should raise (this is currently only the case with Z0).
This is due to the fact that the parser in np_datetime_strings.c cannot raise its own errors since in tslib.pyx, function convert_ts_tsobject(), any ValueError is catched and then a fallback external parser (dateutil) is called.

@jreback jreback changed the title Improve error handling when parsing iso 8601 strings TST/BUG: Improve error handling when parsing iso 8601 strings Nov 27, 2014

@jreback jreback added this to the 0.16.0 milestone Nov 27, 2014

@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015

@jorisvandenbossche

This comment has been minimized.

Copy link
Member

commented Nov 11, 2016

I currently get a clear error message that the string cannot be converted:

In [16]: pd.Timestamp('2014-11-02 01:00Z')
Out[16]: Timestamp('2014-11-02 01:00:00+0000', tz='UTC')

In [17]: pd.Timestamp('2014-11-02 01:00Z00')
---------------------------------------------------------------------------
...
ValueError: Unable to parse b'2014-11-02 01:00Z00'

During handling of the above exception, another exception occurred:
...
ValueError: Unknown string format

During handling of the above exception, another exception occurred:
...
ValueError: could not convert string to Timestamp

What is the desired improvement in this issue? (possibly that it also has changed since reporting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.