Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BUG: allow missing values in Index when calling Index.sort_values #35604
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: allow missing values in Index when calling Index.sort_values #35604
Changes from 62 commits
076061b
3fa9351
333c6e4
8414fd0
fa12898
e2575c9
4293e22
275067e
098fe10
f0d4c2d
743eca6
9d17d7a
744e5c1
13fcd94
33b02da
73cc94c
153fb06
3481b81
9d92ddd
7ec9e7e
2d16b8d
8939040
066f0af
7e351cd
79ed8ee
62268e8
5cab3d4
30ac949
0ac0a3c
051c3e7
dfdee40
acf6170
4b43852
fb8f703
fc58c3f
1dfd4f2
65c001a
dd82cc1
a3855ad
481de59
c7e8240
ad29fff
6ae6e8a
213b13b
760bda1
d8f9061
2f8bec6
29d6849
8b81e55
5b2a0d3
a3310ba
e80bc9d
2007699
8fd5a77
2e39294
d78a9a2
5715c31
bfd2e9c
54a6e82
f60d2a8
af92fe8
6d33657
4935309
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
same
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.
@jreback
Sorry, I wasn't at all clear in the xfail messages as to how the tests are different. The one in
period/test_ops.py
checks whetherPeriodIndex
and another non-datetime-like subtype sort duplicates into the same order whendescending=True
. As part of syncing duplicate sorting behavior in the next PR, I'd like to write a general test with anindex_with_duplicates
fixture to check for sorting stability and replace this test.The tests in
test_common.py
xfail, because thena_position
kwarg isn't implemented yet for datetime-like indices. Implementing it would go with implementing stable duplicate sorting behavior and break a bunch of tests. I also intend to deal with that in the next PR as I bring sort_values in sync between all Index subtypes and Series.I've clarified the xfail messages everywhere and added comments with xrefs to the tests in
test_common.py
. Is that acceptable? I think keeping the tests separate makes sense for now.Sorry if I misunderstood your question.
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.
can you isinstance(....) instead
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.
Done.