Skip to content

Commit

Permalink
[SPARK-37730][PYTHON][FOLLOWUP] Split comments to comply pycodestyle …
Browse files Browse the repository at this point in the history
…check

### What changes were proposed in this pull request?

This is a follow-up of a backporting commit, bc54a3f .

### Why are the changes needed?

The original commit doesn't pass the linter check because there was no lint check between SPARK-37380 and SPARK-37834. The content of this PR is a part of SPARK-37834.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the Python Linter.

Closes #37146 from dongjoon-hyun/SPARK-37730.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
dongjoon-hyun committed Jul 11, 2022
1 parent bc54a3f commit 9dd4c07
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python/pyspark/pandas/plot/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ def _make_plot(self):
kwds = self.kwds.copy()

label = pprint_thing(label if len(label) > 1 else label[0])
# `if hasattr(...)` makes plotting compatible with pandas < 1.3, see pandas-dev/pandas#40078.
# `if hasattr(...)` makes plotting compatible with pandas < 1.3,
# see pandas-dev/pandas#40078.
label = (
self._mark_right_label(label, index=i)
if hasattr(self, "_mark_right_label")
Expand All @@ -406,7 +407,8 @@ def _make_plot(self):

kwds = self._make_plot_keywords(kwds, y)
artists = self._plot(ax, y, column_num=i, stacking_id=stacking_id, **kwds)
# `if hasattr(...)` makes plotting compatible with pandas < 1.3, see pandas-dev/pandas#40078.
# `if hasattr(...)` makes plotting compatible with pandas < 1.3,
# see pandas-dev/pandas#40078.
self._append_legend_handles_labels(artists[0], label) if hasattr(
self, "_append_legend_handles_labels"
) else self._add_legend_handle(artists[0], label, index=i)
Expand Down Expand Up @@ -492,7 +494,8 @@ def _make_plot(self):
kwds = self.kwds.copy()

label = pprint_thing(label if len(label) > 1 else label[0])
# `if hasattr(...)` makes plotting compatible with pandas < 1.3, see pandas-dev/pandas#40078.
# `if hasattr(...)` makes plotting compatible with pandas < 1.3,
# see pandas-dev/pandas#40078.
label = (
self._mark_right_label(label, index=i)
if hasattr(self, "_mark_right_label")
Expand All @@ -506,7 +509,8 @@ def _make_plot(self):

kwds = self._make_plot_keywords(kwds, y)
artists = self._plot(ax, y, column_num=i, stacking_id=stacking_id, **kwds)
# `if hasattr(...)` makes plotting compatible with pandas < 1.3, see pandas-dev/pandas#40078.
# `if hasattr(...)` makes plotting compatible with pandas < 1.3,
# see pandas-dev/pandas#40078.
self._append_legend_handles_labels(artists[0], label) if hasattr(
self, "_append_legend_handles_labels"
) else self._add_legend_handle(artists[0], label, index=i)
Expand Down

0 comments on commit 9dd4c07

Please sign in to comment.