-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Some code cleanups #31792
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
Some code cleanups #31792
Conversation
|
||
shape = " x ".join(pprint_thing(s) for s in self.shape) | ||
result = ( | ||
f"{name}: {pprint_thing(self.mgr_locs.indexer)}, " |
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.
AFICT the pprint_thing
is just a python2 thing.
@jbrockmendel can you please confirm or explain what it is?
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.
Yes - shouldn’t be needed now py3 only. Worth checking though
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 please confirm or explain what it is?
I think it might matter if you were dealing with nested objects, but for these i think it is just a leftover py2 thing
Seems to have introduced a few test failures? Generally looks good |
if isinstance(slicer, tuple): | ||
axis0_slicer = slicer[0] | ||
else: | ||
axis0_slicer = slicer |
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.
i tend to like this version because i can see in coverage output whether both cases are reached
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.
@jbrockmendel I can see your point, I like the one-liner version because it's making less noise (IMO).
Anyway I am fine with reverting this one and also others.
Can we open a discussion for it (in a separate issue)? so we will put it in Pandas code style guide
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.
@jbrockmendel are you sticking on this one? +/- 0 on this.
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.
not a deal breaker
85acf78
to
43db70c
Compare
Thanks @MomIsBestFriend |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff