Skip to content

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

Merged
merged 2 commits into from
Aug 20, 2018

Conversation

topper-123
Copy link
Contributor

  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

There is a gigantic and unneeded else clause in Series._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.

@@ -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:
Copy link
Contributor Author

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.

@topper-123 topper-123 force-pushed the clean_Series._get_with branch from de3e551 to bed8d34 Compare August 17, 2018 22:38
return self._get_values(key)
else:
try:
# handle the dup indexing case (GH 4246)
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@codecov
Copy link

codecov bot commented Aug 17, 2018

Codecov Report

Merging #22406 into master will not change coverage.
The diff coverage is 85.71%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22406   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files         169      169           
  Lines       50709    50709           
=======================================
  Hits        46679    46679           
  Misses       4030     4030
Flag Coverage Δ
#multiple 90.46% <85.71%> (ø) ⬆️
#single 42.25% <25%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/series.py 93.72% <85.71%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f6c02d...89fadb0. Read the comment docs.

@topper-123 topper-123 force-pushed the clean_Series._get_with branch from 5b92464 to 89fadb0 Compare August 18, 2018 00:09
@gfyoung gfyoung added Internals Related to non-user accessible pandas implementation Clean labels Aug 19, 2018
@jreback jreback added this to the 0.24.0 milestone Aug 20, 2018
@jreback jreback merged commit 859d895 into pandas-dev:master Aug 20, 2018
@jreback
Copy link
Contributor

jreback commented Aug 20, 2018

thanks

Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
@topper-123 topper-123 deleted the clean_Series._get_with branch October 27, 2018 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants