-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: raise when sort_index with ascending=None #39451
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 7 commits
4f34ed1
8e40cac
513e0c5
dd2d191
f06d5f4
4b8da49
8363293
29dd29a
25b4119
6a422b2
860c8a5
a51a343
e0ebf58
6b430f8
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 |
---|---|---|
|
@@ -761,6 +761,22 @@ def test_sort_index_with_categories(self, categories): | |
) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
@pytest.mark.parametrize( | ||
"ascending", | ||
[ | ||
None, | ||
(True, None), | ||
(False, "True"), | ||
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. can you make these lists 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. and maybe add an empty list too 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. Currently an empty list does not raise an error, so the test fails. |
||
], | ||
) | ||
def test_sort_index_ascending_bad_value_raises(self, ascending): | ||
jreback marked this conversation as resolved.
Show resolved
Hide resolved
|
||
df = DataFrame(np.arange(64)) | ||
length = len(df.index) | ||
df.index = [(i - length / 2) % length for i in range(length)] | ||
match = 'For argument "ascending" expected type bool' | ||
with pytest.raises(ValueError, match=match): | ||
df.sort_index(axis=0, ascending=ascending, na_position="first") | ||
|
||
|
||
class TestDataFrameSortIndexKey: | ||
def test_sort_multi_index_key(self): | ||
|
Uh oh!
There was an error while loading. Please reload this page.