Skip to content

Commit

Permalink
COMPAT: numpy 1.13 test compat (#16654)
Browse files Browse the repository at this point in the history
* COMPAT: numpy 1.13 test compat

* CI: fix doc build to 1.12

(cherry picked from commit dc716b0)

Did not include the change in `ci/requirements-3.6_DOC.build` fixing
numpy to 1.12*
  • Loading branch information
TomAugspurger committed Jul 7, 2017
1 parent 9c1fa06 commit 4e39a06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pandas/compat/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
_np_version_under1p11 = _nlv < '1.11'
_np_version_under1p12 = _nlv < '1.12'
_np_version_under1p13 = _nlv < '1.13'
_np_version_under1p14 = _nlv < '1.14'

if _nlv < '1.7.0':
raise ImportError('this version of pandas is incompatible with '
Expand Down Expand Up @@ -74,4 +75,6 @@ def np_array_datetime64_compat(arr, *args, **kwargs):
'_np_version_under1p10',
'_np_version_under1p11',
'_np_version_under1p12',
'_np_version_under1p13',
'_np_version_under1p14'
]
6 changes: 5 additions & 1 deletion pandas/tests/test_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from pandas.core.api import DataFrame, Panel
from pandas.core.computation import expressions as expr
from pandas import compat, _np_version_under1p11
from pandas import compat, _np_version_under1p11, _np_version_under1p13
from pandas.util.testing import (assert_almost_equal, assert_series_equal,
assert_frame_equal, assert_panel_equal,
assert_panel4d_equal, slow)
Expand Down Expand Up @@ -420,6 +420,10 @@ def test_bool_ops_warn_on_arithmetic(self):
f = getattr(operator, name)
fe = getattr(operator, sub_funcs[subs[op]])

# >= 1.13.0 these are now TypeErrors
if op == '-' and not _np_version_under1p13:
continue

with tm.use_numexpr(True, min_elements=5):
with tm.assert_produces_warning(check_stacklevel=False):
r = f(df, df)
Expand Down

0 comments on commit 4e39a06

Please sign in to comment.