Skip to content

BUG: resolved problem with DataFrame.equals() (#28839) #29657

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

Merged
merged 4 commits into from
Nov 19, 2019

Conversation

Reksbril
Copy link
Contributor

@Reksbril Reksbril commented Nov 16, 2019

The function was returning True in case shown in added test. The cause
of the problem was sorting Blocks of DataFrame by type, and then
mgr_locs before comparison. It resulted in arranging the identical blocks
in the same way, which resulted in having the same two lists of blocks.
Changing sorting order to (mgr_locs, type) resolves the problem, while not
interrupting the other aspects of comparison.

@jreback jreback added the Bug label Nov 16, 2019
@jreback jreback added this to the 1.0 milestone Nov 16, 2019
@jreback jreback added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Nov 16, 2019
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.

lgtm. can you add a whatsnew note, put it in bug fixes reshaping. be pretty generic, e.g. .equals() can return True incorrectly under some circumstances.

@jreback
Copy link
Contributor

jreback commented Nov 16, 2019

also merge master

Mateusz Górski added 3 commits November 18, 2019 16:59
…andas-dev#28839)

The function was returning True in case shown in added test. The cause
of the problem was sorting Blocks of DataFrame by type, and then
mgr_locs before comparison. It resulted in arranging the identical blocks
in the same way, which resulted in having the same two lists of blocks.
Changing sorting order to (mgr_locs, type) resolves the problem, while not
interrupting the other aspects of comparison.
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; potentially can improve whatsnew though not a blocker for me

@jreback jreback merged commit 3005908 into pandas-dev:master Nov 19, 2019
@jreback
Copy link
Contributor

jreback commented Nov 19, 2019

thanks @Reksbril

@jbrockmendel
Copy link
Member

LGTM pending Will's comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrame.equals() wrongly returns True in case of identical blocks with different locations
4 participants