-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: clean more uses of python2-style super() #26261
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
@@ -6336,8 +6336,7 @@ def _aggregate(self, arg, axis=0, *args, **kwargs): | |||
if axis == 1: | |||
# NDFrame.aggregate returns a tuple, and we need to transpose | |||
# only result | |||
result, how = (super(DataFrame, self.T) | |||
._aggregate(arg, *args, **kwargs)) | |||
result, how = self.T._aggregate(arg, *args, **kwargs) |
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.
This is more readable IMO.
@@ -6348,7 +6347,7 @@ def _aggregate(self, arg, axis=0, *args, **kwargs): | |||
def transform(self, func, axis=0, *args, **kwargs): | |||
axis = self._get_axis_number(axis) | |||
if axis == 1: | |||
return super(DataFrame, self.T).transform(func, *args, **kwargs).T | |||
return self.T.transform(func, *args, **kwargs).T |
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.
This is more readable IMO.
Codecov Report
@@ Coverage Diff @@
## master #26261 +/- ##
==========================================
- Coverage 91.97% 91.97% -0.01%
==========================================
Files 175 175
Lines 52386 52386
==========================================
- Hits 48184 48181 -3
- Misses 4202 4205 +3
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #26261 +/- ##
==========================================
- Coverage 91.97% 91.97% -0.01%
==========================================
Files 175 175
Lines 52386 52386
==========================================
- Hits 48184 48181 -3
- Misses 4202 4205 +3
Continue to review full report at Codecov.
|
thanks @topper-123 |
Simplifies the uses of
super
by converting to use python3 idioms. This is a followup to #26177, focusing on uses ofsuper
in class methods.Also adds a check for python2-style uses of
super
in code_checks.sh.