Skip to content

Commit 5c2ca71

Browse files
committed
fix failed cicd
1 parent 84d2d79 commit 5c2ca71

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/plotting/_matplotlib/boxplot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,10 @@ def _make_plot(self, fig: Figure) -> None:
212212

213213
# When `by` is assigned, the ticklabels will become unique grouped
214214
# values, instead of label which is used as subtitle in this case.
215-
# error: "Index" has no attribute "levels"; maybe "nlevels"?
216-
levels = self.data.columns.levels # type: ignore[attr-defined]
217-
ticklabels = [pprint_thing(col) for col in self.data.columns.get_level_values(0)] #
215+
ticklabels = [
216+
pprint_thing(col)
217+
for col in self.data.columns.get_level_values(0)
218+
]
218219
else:
219220
ticklabels = [pprint_thing(label)]
220221

pandas/tests/plotting/test_boxplot_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def test_boxplot_group_no_xlabel_ylabel(self, vert, request):
410410
assert target_label == pprint_thing(["group"])
411411

412412
@pytest.mark.filterwarnings("ignore:set_ticklabels:UserWarning")
413-
def test_boxplot_group_xlabel_ylabel(self, vert):
413+
def test_boxplot_group_ordered_ticklabel(self, vert):
414414
df = DataFrame({'value': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
415415
'label': ['c', 'c', 'c', 'c', 'b', 'b', 'b', 'b', 'a', 'a']})
416416
df.label = Categorical(df.label, categories=['c', 'b', 'a'], ordered=True)

0 commit comments

Comments
 (0)