-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Fix index bug due to parse_time_string GH24091 #24294
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
Conversation
Hello @SimonAlecks! Thanks for submitting the PR.
|
Codecov Report
@@ Coverage Diff @@
## master #24294 +/- ##
==========================================
- Coverage 92.22% 92.22% -0.01%
==========================================
Files 162 162
Lines 51824 51824
==========================================
- Hits 47795 47794 -1
- Misses 4029 4030 +1
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #24294 +/- ##
==========================================
- Coverage 92.22% 92.22% -0.01%
==========================================
Files 162 162
Lines 51824 51824
==========================================
- Hits 47795 47794 -1
- Misses 4029 4030 +1
Continue to review full report at Codecov.
|
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.
add a test for the OP
@@ -1611,6 +1611,7 @@ Other | |||
- Bug in :meth:`DataFrame.combine_first` in which column types were unexpectedly converted to float (:issue:`20699`) | |||
- Bug where C variables were declared with external linkage causing import errors if certain other C libraries were imported before Pandas. (:issue:`24113`) | |||
- Constructing a DataFrame with an index argument that wasn't already an instance of :class:`~pandas.core.Index` was broken in `4efb39f <https://github.com/pandas-dev/pandas/commit/4efb39f01f5880122fa38d91e12d217ef70fad9e>`_ (:issue:`22227`). | |||
- :meth:`~pandas._libs.tslibs.parsing.parse_time_string` now raises a type error if the passed argument is not a string, (:issue:`24091`) |
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.
use TypeError
. this is an internal method and doesn't need a note for this, rather the use facing case does.
@@ -25,6 +25,8 @@ def test_parse_time_string(self): | |||
assert parsed == parsed_lower | |||
assert reso == reso_lower | |||
|
|||
pytest.raises(TypeError, parse_time_string, Period('2018-11-01', 'B')) |
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.
use a context manger here, make this a separate test, and add the issue as a comment
can you merge master and update |
Closing as stale. Ping if you'd like to continue |
git diff upstream/master -u -- "*.py" | flake8 --diff
In Issue #24091 I detailed the root cause of the bug, and implemented the @toobaz suggestion.
I added a single line to test this case in the existing test, ran the full UT suite, checked the linting, and added a whatsnew (I added the whatsnew in the other category, as It wasn't clear where it belonged).