-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH Assert_frame_equal check_names to True #2964
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
@wesm @changhiskhan @jreback Do you think this is ok to merge in? I'm being a bit wary of changing the behaviour of assert_frame_equals if you're not onboard. (Since, it could lead to test passes merging into test fails, if assert_frame_equals is used in a test to frames with distinct column/index names.) |
any tests failing? |
@jreback Nope it's "good to merge".. |
@hayd so you basically set I guess maybe make a new issue refing this one....so you (or someone) can follow up in those cases.....they seem like the should work..... |
The original PR #2962 does just that (sets it to False), this second one sets it True... I had to go in and fixed those calls to assert_frame_equals where it wasn't working, either by setting check_names=False, changing the name (of an expected/result) or flagging it with TODO (and setting check_names=False) if I thought it could be a bug. Then I (or someone) can then follow them up :) |
This looks fine to merge to me. I think it'll help catch bugs |
ENH Assert_frame_equal check_names to True
Sorry about that, I've a line in release notes in the PR above. |
This is a follow up to #2962, where I added a
check_names=False
argument toassert_frame_equal
, this defaults it toTrue
. That is, when asserting two DataFrames are equal, it compares.columns.names
and.index.names
, unless explicitly passingcheck_names=False
.I've added in
check_names=False
where it wouldn't make sense to check names. I've added a TODO comment (andcheck_names=False
) where I think it probably should work but isn't... This was in the following cases:i.e. these appear to drop column names (
df.columns.names
). Whether this behaviour is correct / desired in these cases, I'm not sure, but here they all are. :)Note: By changing the A1 cells to 'index', I had all but one test (labelled "read xls ignores index name ?") in
test_excel.py
working locally (withcheck_names=True
) , however Travis was less convinced throwing:so I reverted to the previous xls and xlsx, and added back in
check_names=False
. I suspect LibreOffice wasn't saving it properly...?