Skip to content

Commit 1cf1b96

Browse files
TST: skip assert for mpl 3.1+ (#26715)
* TST: skip assert for mpl 3.1+ * MPL compat * remove pyarrow * mpl compat
1 parent ef30df8 commit 1cf1b96

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

ci/deps/travis-36-cov.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ dependencies:
2020
# https://github.com/pydata/pandas-gbq/issues/271
2121
- google-cloud-bigquery<=1.11
2222
- psycopg2
23-
- pyarrow=0.9.0
23+
# pyarrow segfaults on load: https://github.com/pandas-dev/pandas/issues/26716
24+
# - pyarrow=0.9.0
2425
- pymysql
2526
- pytables
2627
- python-snappy

pandas/tests/plotting/common.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def setup_method(self, method):
3636

3737
self.mpl_ge_2_2_3 = plotting._compat._mpl_ge_2_2_3()
3838
self.mpl_ge_3_0_0 = plotting._compat._mpl_ge_3_0_0()
39+
self.mpl_ge_3_1_0 = plotting._compat._mpl_ge_3_1_0()
3940

4041
self.bp_n_objects = 7
4142
self.polycollection_factor = 2
@@ -440,10 +441,18 @@ def _check_grid_settings(self, obj, kinds, kws={}):
440441
import matplotlib as mpl
441442

442443
def is_grid_on():
443-
xoff = all(not g.gridOn
444-
for g in self.plt.gca().xaxis.get_major_ticks())
445-
yoff = all(not g.gridOn
446-
for g in self.plt.gca().yaxis.get_major_ticks())
444+
xticks = self.plt.gca().xaxis.get_major_ticks()
445+
yticks = self.plt.gca().yaxis.get_major_ticks()
446+
# for mpl 2.2.2, gridOn and gridline.get_visible disagree.
447+
# for new MPL, they are the same.
448+
449+
if self.mpl_ge_3_0_0:
450+
xoff = all(not g.gridline.get_visible() for g in xticks)
451+
yoff = all(not g.gridline.get_visible() for g in yticks)
452+
else:
453+
xoff = all(not g.gridOn for g in xticks)
454+
yoff = all(not g.gridOn for g in yticks)
455+
447456
return not (xoff and yoff)
448457

449458
spndx = 1

pandas/tests/plotting/test_frame.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,10 @@ def test_subplots(self):
383383
for ax in axes[:-2]:
384384
self._check_visible(ax.xaxis) # xaxis must be visible for grid
385385
self._check_visible(ax.get_xticklabels(), visible=False)
386-
self._check_visible(
387-
ax.get_xticklabels(minor=True), visible=False)
386+
if not (kind == 'bar' and self.mpl_ge_3_1_0):
387+
# change https://github.com/pandas-dev/pandas/issues/26714
388+
self._check_visible(
389+
ax.get_xticklabels(minor=True), visible=False)
388390
self._check_visible(ax.xaxis.get_label(), visible=False)
389391
self._check_visible(ax.get_yticklabels())
390392

0 commit comments

Comments
 (0)