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 2 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
8 changes: 5 additions & 3 deletions pandas/tests/extension/base/dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import numpy as np
import pytest

from pandas.compat.numpy import _np_version_under1p20

import pandas as pd

from .base import BaseExtensionTests
Expand Down Expand Up @@ -70,13 +72,13 @@ def test_check_dtype(self, data):

# np.dtype('int64') == 'Int64' == 'int64'
# so can't distinguish
if dtype.name == "Int64":
if dtype.name == "Int64" and _np_version_under1p20:
# TODO(numpy-1.20): This if block and the warnings filter can be removed
# once we require numpy>=1.20
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
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
result = df.dtypes == str(dtype)
Expand Down