-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: Avoid regression warning with ea dtype and assert_index_equal order False #47325
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,8 +367,8 @@ def _get_ilevel_values(index, level): | |
|
||
# If order doesn't matter then sort the index entries | ||
if not check_order: | ||
left = Index(safe_sort(left)) | ||
right = Index(safe_sort(right)) | ||
left = Index(safe_sort(left), dtype=left.dtype) | ||
right = Index(safe_sort(right), dtype=right.dtype) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe another issue, but the check_names check is later. It maybe that would need to resuse the code pattern you added in #47206. Not here, as this PR is targeted 1.4.3, just an observation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I am not using that myself, so I am a bit fuzzy on all the keywords :) It is actually a bit more comlex, because These calls return regular indexes, even if a MultiIndex was given. I'll open an issue about it Edit: Sorry misunderstood you. You are correct, we have to use exactly the same pattern There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my thinking was that your fix in #47206 looked quite useful to robustly sort indexes. and maybe a safe_sort_index would be handy. (IIRC we cannot support pandas objects in safe_sort but would need to check this). I wonder can the fix in #47206 suffer from the rogue warning too without the dtype specified there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep you are completely right. Opened #47330 for 1.5 |
||
|
||
# MultiIndex special comparison for little-friendly error messages | ||
if left.nlevels > 1: | ||
|
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.
@phofl FYI
:func:`assert_index_equal`
doesn't render. probably needs to be:func:`testing.assert_index_equal`
.no need to follow-up as can be done with other cleanups before release.
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.
Thanks, will try to do correctly in the future