-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fix issue #4496: tslib.tz_convert(vals, tz1, tz2) may raise an IndexErro... #4497
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
Fix issue #4496: tslib.tz_convert(vals, tz1, tz2) may raise an IndexErro... #4497
Conversation
couple of things, please do the following
|
try: | ||
hour = idx.hour | ||
except: | ||
self.assert_(False), 'tslib.tz_convert() "trans[pos + 1] out of bounds" bug found.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should rewrite this according to what the hour should be here, don't catch every exception: that could hide another bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed.
Should I create a new Pull request, or just wait while this one is approved?
|
@stenri can you rebase and hook up travis? |
Surely. I rebased tslib_tz_convert_trans_pos_plus_1__bugfix against upstream/master (and combined all my commits into a one commit). |
@@ -197,6 +197,27 @@ See :ref:`Internal Refactoring<whatsnew_0130.refactoring>` | |||
- raising an invalid ``TypeError`` rather than ``ValueError`` when appending | |||
with a different block ordering (:issue:`4096`) | |||
- ``read_hdf`` was not respecting as passed ``mode`` (:issue:`4504`) | |||
- Fixed bug in tslib.tz_convert(vals, tz1, tz2): it could raise IndexError exception while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you just make this a one-liner here? (and put the explanation with the test, though could be a bit shorter)...thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well.. ok. Though Phillip Cloud asked me to do something that looks exact the opposite (initially my detailed explanation was located within the test doc string):
"add documentation to doc/release.rst, preferentially move the docstring in your test to release notes, but not necessary. if you just want to add a blurb that's fine too."
Anyway, I'll try to make my explanation shorter, and put a one-liner in release.rst.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the confusion. The idea is that release notes is a pretty short explanation, a doc-string is user visibile should shouldn't be that crazy. Docs can be full explanation. But, in this case its actually a bug fix reference (that won't be there after), so can put in the test suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I see. I removed detailed explanation from release.rst. Now both release.rst and doc string in unit-test reference Issue #4496, where I wrote the detailed bug description. So interested person can look there for details.
@stenri can you squash into 1 commit? then will merge |
… an IndexError exception.
Excellent! Done. |
…1__bugfix Fix issue #4496: tslib.tz_convert(vals, tz1, tz2) may raise an IndexErro...
thanks! |
Bug-fix for Issue #4496 Bug: tslib.tz_convert(vals, tz1, tz2) may raise an IndexError exception.