Skip to content

Commit

Permalink
COMPAT: numpy 1.13 test compat (pandas-dev#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
  • Loading branch information
jreback authored and stangirala committed Jun 11, 2017
1 parent 107e2f4 commit 27e106e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci/requirements-3.6_DOC.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python=3.6*
python-dateutil
pytz
numpy
numpy=1.12*
cython
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 27e106e

Please sign in to comment.