-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: dedent else part of Series._get_with #22406
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
@@ -828,47 +828,46 @@ def _get_with(self, key): | |||
elif isinstance(key, ABCDataFrame): | |||
raise TypeError('Indexing a Series with DataFrame is not ' | |||
'supported, use the appropriate DataFrame column') | |||
else: |
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.
Git formats the diff below a bit funky, but the red part is a contigous block while the green part is the same block, but dedented.
de3e551
to
bed8d34
Compare
pandas/core/series.py
Outdated
return self._get_values(key) | ||
else: | ||
try: | ||
# handle the dup indexing case (GH 4246) |
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.
you can remove this else as well
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.
Codecov Report
@@ Coverage Diff @@
## master #22406 +/- ##
=======================================
Coverage 92.05% 92.05%
=======================================
Files 169 169
Lines 50709 50709
=======================================
Hits 46679 46679
Misses 4030 4030
Continue to review full report at Codecov.
|
5b92464
to
89fadb0
Compare
thanks |
git diff upstream/master -u -- "*.py" | flake8 --diff
There is a gigantic and unneeded
else
clause inSeries._get_with
and it makes the code hard to read.This PR removes the else clause and dedents its content one level. This helps readability.