-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: reshape fix for maybe_infer_to_datetimelike() #16395
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
BUG: reshape fix for maybe_infer_to_datetimelike() #16395
Conversation
tests should always be included. generally I write them first to ensure that they are picking up the bug. you can push to this PR itself. |
Codecov Report
@@ Coverage Diff @@
## master #16395 +/- ##
==========================================
- Coverage 90.41% 90.4% -0.01%
==========================================
Files 161 161
Lines 50997 50997
==========================================
- Hits 46107 46106 -1
- Misses 4890 4891 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #16395 +/- ##
=======================================
Coverage 90.42% 90.42%
=======================================
Files 161 161
Lines 51033 51033
=======================================
Hits 46148 46148
Misses 4885 4885
Continue to review full report at Codecov.
|
@jreback I might need some guidance...I might not have needed to touch this -- the branch had a new conflict, I imagine because of other merged PRs, but only with whatsnew. Now I'm not sure how to fix it back to a state where tests pass. |
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.
rebase on master
git pull origin/master
git rebase -i origin/master
then when pushing
git push yourupstream yourbranch -f
pandas/tests/dtypes/test_cast.py
Outdated
@@ -213,6 +213,13 @@ def test_maybe_convert_scalar(self): | |||
result = maybe_convert_scalar(Timedelta('1 day 1 min')) | |||
assert result == Timedelta('1 day 1 min').value | |||
|
|||
def test_maybe_infer_to_datetimelike(self): | |||
|
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 the issue number here
pandas/tests/dtypes/test_cast.py
Outdated
def test_maybe_infer_to_datetimelike(self): | ||
|
||
# this construction raises IndexError in pandas=0.20.1 | ||
result = DataFrame(np.array([[NaT, 'a', 'b', 0], |
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 both examples from here: #16362 (comment)
and assert the result to an expected result == 8
pls add a whatsnew note in 0.20.2 (bug fixes, reshaping section) |
Does cd11b49 look like the full set of changes, aside from the whatsnew? |
It looks like you lost some changes, but you should be able to recover them with your git reflog, assuming you haven't cleared it manually. Or maybe even a |
@TomAugspurger thanks, didn't have much time today and thankfully this is such a small change so I just redid the changes. I did add one more test assertion this morning upon Jeff's recommendation, and that's included here as well. |
thanks @RobinFiveWords |
closes pandas-dev#16362 Author: RobinFiveWords <[email protected]> Closes pandas-dev#16395 from RobinFiveWords/cast-infer-datetime-reshape-fix and squashes the following commits: 7ad1e7d [RobinFiveWords] redid lost changes to cast.py and test_cast.py afa2eeb [RobinFiveWords] added whatsnew0.20.2 entry 7a35624 [RobinFiveWords] removed whatsnew entry again 2ec60a6 [RobinFiveWords] added back whatsnew change (cherry picked from commit 05d0667)
closes #16362 Author: RobinFiveWords <[email protected]> Closes #16395 from RobinFiveWords/cast-infer-datetime-reshape-fix and squashes the following commits: 7ad1e7d [RobinFiveWords] redid lost changes to cast.py and test_cast.py afa2eeb [RobinFiveWords] added whatsnew0.20.2 entry 7a35624 [RobinFiveWords] removed whatsnew entry again 2ec60a6 [RobinFiveWords] added back whatsnew change (cherry picked from commit 05d0667)
closes pandas-dev#16362 Author: RobinFiveWords <[email protected]> Closes pandas-dev#16395 from RobinFiveWords/cast-infer-datetime-reshape-fix and squashes the following commits: 7ad1e7d [RobinFiveWords] redid lost changes to cast.py and test_cast.py afa2eeb [RobinFiveWords] added whatsnew0.20.2 entry 7a35624 [RobinFiveWords] removed whatsnew entry again 2ec60a6 [RobinFiveWords] added back whatsnew change
git diff upstream/master --name-only -- '*.py' | flake8 --diff