Skip to content

Conversation

dsaxton
Copy link
Contributor

@dsaxton dsaxton commented Mar 9, 2021

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@dsaxton dsaxton added Bug Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff labels Mar 9, 2021
@dsaxton dsaxton added this to the 1.2.4 milestone Mar 9, 2021
k, kind=kind, ascending=ascending, na_position=na_position, key=key
)
else:
return self
Copy link
Contributor

Choose a reason for hiding this comment

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

return self.copy()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, updated

with pytest.raises(ValueError, match=msg):
frame.sort_values(by=["A", "B"], axis=0, ascending=[True] * 5)

# https://github.com/pandas-dev/pandas/issues/40258
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a separate test. also assert that it is not the same frame.

Copy link
Contributor

Choose a reason for hiding this comment

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

can you make a completely separate test

Copy link
Contributor

Choose a reason for hiding this comment

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

we dont' normally want to mix error checking with other things

~~~~~~~~~

-
- Fixed bug in :meth:`DataFrame.sort_values` raising an :class:`IndexError` for empty ``by`` (:issue:`40258`)
Copy link
Contributor

Choose a reason for hiding this comment

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

move to 1.3, this is an expansion not a regression.

with pytest.raises(ValueError, match=msg):
frame.sort_values(by=["A", "B"], axis=0, ascending=[True] * 5)

# https://github.com/pandas-dev/pandas/issues/40258
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make a completely separate test

with pytest.raises(ValueError, match=msg):
frame.sort_values(by=["A", "B"], axis=0, ascending=[True] * 5)

# https://github.com/pandas-dev/pandas/issues/40258
Copy link
Contributor

Choose a reason for hiding this comment

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

we dont' normally want to mix error checking with other things

@dsaxton dsaxton modified the milestones: 1.2.4, 1.3 Mar 9, 2021
@jreback jreback merged commit 00e684f into pandas-dev:master Mar 9, 2021
@jreback
Copy link
Contributor

jreback commented Mar 9, 2021

thanks @dsaxton

@dsaxton dsaxton deleted the sort-values-empty-by branch March 10, 2021 00:17
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants