-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Remove redundant check arr_or_dtype is None #26655
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
Conversation
Checking whether `if arr_or_dtype is None:` is done in the beginning of the function so the following check is redundant and can be safely removed
Codecov Report
@@ Coverage Diff @@
## master #26655 +/- ##
==========================================
- Coverage 91.87% 91.87% -0.01%
==========================================
Files 174 174
Lines 50683 50681 -2
==========================================
- Hits 46567 46563 -4
- Misses 4116 4118 +2
Continue to review full report at Codecov.
|
Hey, thanks for contributing! Could you remove the first occurrence of the pattern, rather than the second, so all fastpaths are collected. Else looks good. Ping on green. With regards to the proposed tool, could you bring it up on the issue tracker, so it can get a separate discussion from the PR. |
Keeping the check under the fastpath block so all fastpaths are collected.
Hello @AlexTereshenkov! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-06-05 12:42:41 UTC |
Strip whitespace
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.
small comment
Moving the check
It's funny as I was told the opposite first as you can see in the comment above. :) no worries, moved it back agian... |
ahh ok, this lgtm. ping on green. |
@jreback green! |
@topper-123 thanks for the suggestion, I've raised #26664 for this |
thanks @AlexTereshenkov |
No worries at all! There are more issues that are found by LGTM.com but they are more complex so I may need to raise an issue first to let someone verify that this is a bug and not just some obscure magic that is necessary to get |
git diff upstream/master -u -- "*.py" | flake8 --diff
Checking whether
if arr_or_dtype is None
is done in the beginning of the function so the following check is redundant and can be safely removed.This issue (among a few others) were flagged up by LGTM.com website: https://lgtm.com/projects/g/pandas-dev/pandas/alerts/?mode=tree. Some of the other numerical computing repositories have been analyzed there as well such as numpy and scipy.
If you like, you can use LGTM for automatically reviewing code in pull requests. Here's an example of how Google's AMPHTML use that to flag up security vulnerabilities in their code base: ampproject/amphtml#13060.
(full disclosure: I'm a huge fan of
pandas
and also part of the team that runs LGTM.com)