Skip to content

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

Closed
wants to merge 4 commits into from
Closed

BUG: reshape fix for maybe_infer_to_datetimelike() #16395

wants to merge 4 commits into from

Conversation

RobinFiveWords
Copy link

@RobinFiveWords RobinFiveWords commented May 20, 2017

@jreback
Copy link
Contributor

jreback commented May 20, 2017

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.

@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Datetime Datetime data dtype labels May 20, 2017
@codecov
Copy link

codecov bot commented May 20, 2017

Codecov Report

Merging #16395 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 88.24% <100%> (-0.01%) ⬇️
#single 40.19% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/dtypes/cast.py 86.89% <100%> (ø) ⬆️
pandas/core/common.py 91.05% <0%> (-0.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f55de1...be04d14. Read the comment docs.

@codecov
Copy link

codecov bot commented May 20, 2017

Codecov Report

Merging #16395 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16395   +/-   ##
=======================================
  Coverage   90.42%   90.42%           
=======================================
  Files         161      161           
  Lines       51033    51033           
=======================================
  Hits        46148    46148           
  Misses       4885     4885
Flag Coverage Δ
#multiple 88.26% <100%> (ø) ⬆️
#single 40.17% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/dtypes/cast.py 86.89% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7271f50...7ad1e7d. Read the comment docs.

@RobinFiveWords
Copy link
Author

@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.

Copy link
Contributor

@jreback jreback left a 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

@@ -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):

Copy link
Contributor

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

def test_maybe_infer_to_datetimelike(self):

# this construction raises IndexError in pandas=0.20.1
result = DataFrame(np.array([[NaT, 'a', 'b', 0],
Copy link
Contributor

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

@jreback
Copy link
Contributor

jreback commented May 24, 2017

pls add a whatsnew note in 0.20.2 (bug fixes, reshaping section)

@TomAugspurger
Copy link
Contributor

Does cd11b49 look like the full set of changes, aside from the whatsnew?

@TomAugspurger
Copy link
Contributor

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 git reset --soft cd11b49. If you ping me on gitter I can walk you through the recover steps.

@RobinFiveWords
Copy link
Author

@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.

@jreback jreback added this to the 0.20.2 milestone May 24, 2017
@jreback jreback closed this in 05d0667 May 24, 2017
@jreback
Copy link
Contributor

jreback commented May 24, 2017

thanks @RobinFiveWords

TomAugspurger pushed a commit to TomAugspurger/pandas that referenced this pull request May 29, 2017
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)
TomAugspurger pushed a commit that referenced this pull request May 30, 2017
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)
stangirala pushed a commit to stangirala/pandas that referenced this pull request Jun 11, 2017
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
@RobinFiveWords RobinFiveWords deleted the cast-infer-datetime-reshape-fix branch June 12, 2017 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Transpose construction/block error with certain dtypes
3 participants