Skip to content

Debug CI Issue #34721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pandas/compat/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
_np_version_under1p16 = _nlv < LooseVersion("1.16")
_np_version_under1p17 = _nlv < LooseVersion("1.17")
_np_version_under1p18 = _nlv < LooseVersion("1.18")
_np_version_under1p19 = _nlv < LooseVersion("1.19")
_np_version_under1p20 = _nlv < LooseVersion("1.20")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is targeted for NumPy 1.20, but verifying in numpy/numpy#16554 (comment).

_is_numpy_dev = ".dev" in str(_nlv)


Expand Down
22 changes: 13 additions & 9 deletions pandas/tests/extension/base/dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,22 @@ def test_check_dtype(self, data):
{"A": pd.Series(data, dtype=dtype), "B": data, "C": "foo", "D": 1}
)

# np.dtype('int64') == 'Int64' == 'int64'
# so can't distinguish
if dtype.name == "Int64":
expected = pd.Series([True, True, False, True], index=list("ABCD"))
else:
expected = pd.Series([True, True, False, False], index=list("ABCD"))

# FIXME: This should probably be *fixed* not ignored.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that there's anything we can actually do here. Open to suggestions, but the fact is that NumPy controls the behavior of np.dtype.__eq__. So I'm comfortable just leaving this for NumPy<1.20.

# See libops.scalar_compare
# TODO(numpy-1.20): This warnings filter and if block can be removed
# once we require numpy>=1.20
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
result = df.dtypes == str(dtype)
# NumPy>=1.20.0, but not pandas.compat.numpy till there
# is a wheel available with this change.
try:
new_numpy_behavior = np.dtype("int64") != "Int64"
except TypeError:
new_numpy_behavior = True

if dtype.name == "Int64" and not new_numpy_behavior:
expected = pd.Series([True, True, False, True], index=list("ABCD"))
else:
expected = pd.Series([True, True, False, False], index=list("ABCD"))

self.assert_series_equal(result, expected)

Expand Down
6 changes: 5 additions & 1 deletion pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,17 @@ def test_bootstrap_plot(self):
class TestDataFramePlots(TestPlotBase):
@td.skip_if_no_scipy
def test_scatter_matrix_axis(self):
from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0

scatter_matrix = plotting.scatter_matrix

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

# we are plotting multiples on a sub-plot
with tm.assert_produces_warning(UserWarning):
with tm.assert_produces_warning(
UserWarning, raise_on_extra_warnings=_mpl_ge_3_0_0()
):
axes = _check_plot_works(
scatter_matrix, filterwarnings="always", frame=df, range_padding=0.1
)
Expand Down