-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
CLN: raise correct error for Panel sort_values #16532
CLN: raise correct error for Panel sort_values #16532
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16532 +/- ##
==========================================
+ Coverage 90.79% 90.8% +<.01%
==========================================
Files 161 161
Lines 51063 51062 -1
==========================================
Hits 46365 46365
+ Misses 4698 4697 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #16532 +/- ##
==========================================
- Coverage 90.79% 90.75% -0.05%
==========================================
Files 161 161
Lines 51063 51070 +7
==========================================
- Hits 46365 46348 -17
- Misses 4698 4722 +24
Continue to review full report at Codecov.
|
since we are explicit on this error, can you add a test for |
4d9a956
to
4b9a508
Compare
pandas/tests/test_panel.py
Outdated
@@ -2429,6 +2429,10 @@ def test_all_any_unhandled(self): | |||
pytest.raises(NotImplementedError, self.panel.all, bool_only=True) | |||
pytest.raises(NotImplementedError, self.panel.any, bool_only=True) | |||
|
|||
def test_sort_values(self): | |||
pytest.raises(NotImplementedError, self.panel.sort_values) |
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 add the issue reference
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
pandas/tests/test_panel4d.py
Outdated
|
||
|
||
def test_sort_values(self): | ||
pytest.raises(NotImplementedError, self.panel4d.sort_values) |
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 here
minor comments. lgtm. ping on green. |
Makes sense, thanks. Tests added. In hindsight, I have re-added the arguments in the function (making the first argument optional) so that even if the method is called with arguments, as it is done for DataFrames, it still throws a NotImplementedError rather than a TypeError. |
thanks! |
git diff upstream/master --name-only -- '*.py' | flake8 --diff
I do not believe there is a need for tests or whatsnew entry.
I modified the error raised (I think NotImplementedError should reflect better the situation) and added a small docstring to explain that the method is not implemented (similar to other methods in the same class)