Skip to content

Commit 9f687cb

Browse files
authored
STYLE enable pylint: non-parent-init-called (#49819)
* STYLE enable pylint: non-parent-init-called * fixup! STYLE enable pylint: non-parent-init-called
1 parent 17c4e13 commit 9f687cb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pandas/plotting/_matplotlib/boxplot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ class BP(NamedTuple):
5353
lines: dict[str, list[Line2D]]
5454

5555
def __init__(self, data, return_type: str = "axes", **kwargs) -> None:
56-
# Do not call LinePlot.__init__ which may fill nan
5756
if return_type not in self._valid_return_types:
5857
raise ValueError("return_type must be {None, 'axes', 'dict', 'both'}")
5958

6059
self.return_type = return_type
61-
MPLPlot.__init__(self, data, **kwargs)
60+
# Do not call LinePlot.__init__ which may fill nan
61+
MPLPlot.__init__(self, data, **kwargs) # pylint: disable=non-parent-init-called
6262

6363
def _args_adjust(self) -> None:
6464
if self.subplots:

pandas/plotting/_matplotlib/hist.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(
6060
self.bins = bins # use mpl default
6161
self.bottom = bottom
6262
# Do not call LinePlot.__init__ which may fill nan
63-
MPLPlot.__init__(self, data, **kwargs)
63+
MPLPlot.__init__(self, data, **kwargs) # pylint: disable=non-parent-init-called
6464

6565
def _args_adjust(self) -> None:
6666
# calculate bin number separately in different subplots
@@ -192,7 +192,8 @@ def orientation(self) -> Literal["vertical"]:
192192
return "vertical"
193193

194194
def __init__(self, data, bw_method=None, ind=None, **kwargs) -> None:
195-
MPLPlot.__init__(self, data, **kwargs)
195+
# Do not call LinePlot.__init__ which may fill nan
196+
MPLPlot.__init__(self, data, **kwargs) # pylint: disable=non-parent-init-called
196197
self.bw_method = bw_method
197198
self.ind = ind
198199

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ disable = [
131131
"global-statement",
132132
"invalid-overridden-method",
133133
"keyword-arg-before-vararg",
134-
"non-parent-init-called",
135134
"overridden-final-method",
136135
"pointless-statement",
137136
"pointless-string-statement",

0 commit comments

Comments
 (0)