From 9d4c88d37b4e093ca06372124ac5c8781800ab6d Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Fri, 9 Jun 2017 22:09:24 -0400 Subject: [PATCH] COMPAT: numpy 1.13 test compat (#16654) * COMPAT: numpy 1.13 test compat * CI: fix doc build to 1.12 --- ci/requirements-3.6_DOC.build | 2 +- pandas/compat/numpy/__init__.py | 3 +++ pandas/tests/test_expressions.py | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ci/requirements-3.6_DOC.build b/ci/requirements-3.6_DOC.build index bdcfe28105866..37faaa7e4db88 100644 --- a/ci/requirements-3.6_DOC.build +++ b/ci/requirements-3.6_DOC.build @@ -1,5 +1,5 @@ python=3.6* python-dateutil pytz -numpy +numpy=1.12* cython diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py index 4a9a2647ece0f..2c5a18973afa8 100644 --- a/pandas/compat/numpy/__init__.py +++ b/pandas/compat/numpy/__init__.py @@ -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 ' @@ -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' ] diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index fae7bfa513dcd..08c3a25e66b0e 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -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) @@ -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)