Skip to content

Commit e048684

Browse files
authored
Debug CI Issue (pandas-dev#34721)
1 parent 57d056a commit e048684

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

pandas/compat/numpy/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
_np_version_under1p16 = _nlv < LooseVersion("1.16")
1212
_np_version_under1p17 = _nlv < LooseVersion("1.17")
1313
_np_version_under1p18 = _nlv < LooseVersion("1.18")
14+
_np_version_under1p19 = _nlv < LooseVersion("1.19")
15+
_np_version_under1p20 = _nlv < LooseVersion("1.20")
1416
_is_numpy_dev = ".dev" in str(_nlv)
1517

1618

pandas/tests/extension/base/dtype.py

+13-9
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,22 @@ def test_check_dtype(self, data):
6868
{"A": pd.Series(data, dtype=dtype), "B": data, "C": "foo", "D": 1}
6969
)
7070

71-
# np.dtype('int64') == 'Int64' == 'int64'
72-
# so can't distinguish
73-
if dtype.name == "Int64":
74-
expected = pd.Series([True, True, False, True], index=list("ABCD"))
75-
else:
76-
expected = pd.Series([True, True, False, False], index=list("ABCD"))
77-
78-
# FIXME: This should probably be *fixed* not ignored.
79-
# See libops.scalar_compare
71+
# TODO(numpy-1.20): This warnings filter and if block can be removed
72+
# once we require numpy>=1.20
8073
with warnings.catch_warnings():
8174
warnings.simplefilter("ignore", DeprecationWarning)
8275
result = df.dtypes == str(dtype)
76+
# NumPy>=1.20.0, but not pandas.compat.numpy till there
77+
# is a wheel available with this change.
78+
try:
79+
new_numpy_behavior = np.dtype("int64") != "Int64"
80+
except TypeError:
81+
new_numpy_behavior = True
82+
83+
if dtype.name == "Int64" and not new_numpy_behavior:
84+
expected = pd.Series([True, True, False, True], index=list("ABCD"))
85+
else:
86+
expected = pd.Series([True, True, False, False], index=list("ABCD"))
8387

8488
self.assert_series_equal(result, expected)
8589

pandas/tests/plotting/test_misc.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,17 @@ def test_bootstrap_plot(self):
9696
class TestDataFramePlots(TestPlotBase):
9797
@td.skip_if_no_scipy
9898
def test_scatter_matrix_axis(self):
99+
from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0
100+
99101
scatter_matrix = plotting.scatter_matrix
100102

101103
with tm.RNGContext(42):
102104
df = DataFrame(randn(100, 3))
103105

104106
# we are plotting multiples on a sub-plot
105-
with tm.assert_produces_warning(UserWarning):
107+
with tm.assert_produces_warning(
108+
UserWarning, raise_on_extra_warnings=_mpl_ge_3_0_0()
109+
):
106110
axes = _check_plot_works(
107111
scatter_matrix, filterwarnings="always", frame=df, range_padding=0.1
108112
)

0 commit comments

Comments
 (0)