Skip to content

Commit 005486f

Browse files
authored
STYLE: Enable Pylint useless-parent-delegation warning (#49773)
* Enable Pylint useless-parent-delegation warning and remove superfluous overriding methods * Remove annotations that caused errors. Remove @skip_nested annotations that cause test failures and replace them with statements that suppress the useless-parent-delegation warning. * Remove tests that can fall back to the base class * Move a comment to ensure that pre-commit passes
1 parent 3fffb6d commit 005486f

File tree

7 files changed

+6
-13
lines changed

7 files changed

+6
-13
lines changed

pandas/core/apply.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,9 +836,6 @@ def apply_str(self) -> DataFrame | Series:
836836
class FrameRowApply(FrameApply):
837837
axis: AxisInt = 0
838838

839-
def apply_broadcast(self, target: DataFrame) -> DataFrame:
840-
return super().apply_broadcast(target)
841-
842839
@property
843840
def series_generator(self):
844841
return (self.obj._ixs(i, axis=1) for i in range(len(self.columns)))

pandas/core/arrays/datetimelike.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ def view(self, dtype: Literal["m8[ns]"]) -> TimedeltaArray:
514514
def view(self, dtype: Dtype | None = ...) -> ArrayLike:
515515
...
516516

517+
# pylint: disable-next=useless-parent-delegation
517518
def view(self, dtype: Dtype | None = None) -> ArrayLike:
518519
# we need to explicitly call super() method as long as the `@overload`s
519520
# are present in this file.

pandas/core/indexes/multi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2625,6 +2625,7 @@ def get_slice_bound(
26252625
label = (label,)
26262626
return self._partial_tup_index(label, side=side)
26272627

2628+
# pylint: disable-next=useless-parent-delegation
26282629
def slice_locs(self, start=None, end=None, step=None) -> tuple[int, int]:
26292630
"""
26302631
For an ordered MultiIndex, compute the slice locations for input

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ def mode(self, dropna: bool = True) -> Series:
20422042
res_values, index=range(len(res_values)), name=self.name
20432043
)
20442044

2045-
def unique(self) -> ArrayLike:
2045+
def unique(self) -> ArrayLike: # pylint: disable=useless-parent-delegation
20462046
"""
20472047
Return unique values of Series object.
20482048

pandas/tests/extension/decimal/test_decimal.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ class TestCasting(base.BaseCastingTests):
158158

159159

160160
class TestGroupby(base.BaseGroupbyTests):
161-
def test_groupby_agg_extension(self, data_for_grouping):
162-
super().test_groupby_agg_extension(data_for_grouping)
161+
pass
163162

164163

165164
class TestSetitem(base.BaseSetitemTests):

pandas/tests/extension/test_numpy.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ def test_getitem_scalar(self, data):
236236

237237

238238
class TestGroupby(BaseNumPyTests, base.BaseGroupbyTests):
239-
def test_groupby_extension_apply(self, data_for_grouping, groupby_apply_op):
240-
super().test_groupby_extension_apply(data_for_grouping, groupby_apply_op)
239+
pass
241240

242241

243242
class TestInterface(BaseNumPyTests, base.BaseInterfaceTests):
@@ -403,9 +402,6 @@ def test_setitem_scalar_key_sequence_raise(self, data):
403402
def test_setitem_mask(self, data, mask, box_in_series):
404403
super().test_setitem_mask(data, mask, box_in_series)
405404

406-
def test_setitem_mask_raises(self, data, box_in_series):
407-
super().test_setitem_mask_raises(data, box_in_series)
408-
409405
@skip_nested
410406
@pytest.mark.parametrize(
411407
"idx",

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ disable = [
157157
"unspecified-encoding",
158158
"unused-argument",
159159
"unused-variable",
160-
"using-constant-test",
161-
"useless-parent-delegation"
160+
"using-constant-test"
162161
]
163162

164163
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)