From 966741d54eeb07ee381d7c2956aef3c3da2a4214 Mon Sep 17 00:00:00 2001 From: NikhilKumarM <33mnikhilkumar@gmail.com> Date: Mon, 27 Aug 2018 10:01:22 -0400 Subject: [PATCH 1/4] Updated condition to skip for pytables build issue on numpy 1.15 #22098 --- pandas/compat/numpy/__init__.py | 4 +++- pandas/tests/io/test_pytables.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py index cb8ad5e3ea46f..d816b3a9659a2 100644 --- a/pandas/compat/numpy/__init__.py +++ b/pandas/compat/numpy/__init__.py @@ -15,6 +15,7 @@ _np_version_under1p13 = _nlv < LooseVersion('1.13') _np_version_under1p14 = _nlv < LooseVersion('1.14') _np_version_under1p15 = _nlv < LooseVersion('1.15') +_np_version_equal1p15 = _nlv == LooseVersion('1.15') if _nlv < '1.9': raise ImportError('this version of pandas is incompatible with ' @@ -74,5 +75,6 @@ def np_array_datetime64_compat(arr, *args, **kwargs): '_np_version_under1p12', '_np_version_under1p13', '_np_version_under1p14', - '_np_version_under1p15' + '_np_version_under1p15', + '_np_version_equal1p15' ] diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 99c3c659e9b4d..11c9219df5403 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -14,7 +14,7 @@ from pandas import (Series, DataFrame, Panel, MultiIndex, Int64Index, RangeIndex, Categorical, bdate_range, date_range, timedelta_range, Index, DatetimeIndex, - isna, compat, concat, Timestamp, _np_version_under1p15) + isna, compat, concat, Timestamp, _np_version_equal1p15) import pandas.util.testing as tm import pandas.util._test_decorators as td @@ -2192,7 +2192,7 @@ def test_unimplemented_dtypes_table_columns(self): pytest.raises(TypeError, store.append, 'df_unimplemented', df) @pytest.mark.skipif( - not _np_version_under1p15, + _np_version_equal1p15, reason=("pytables conda build package needs build " "with numpy 1.15: gh-22098")) def test_calendar_roundtrip_issue(self): From cc2ea5b6c6678d1a2b142b0e59cdf91cdd7ae912 Mon Sep 17 00:00:00 2001 From: NikhilKumarM <33mnikhilkumar@gmail.com> Date: Mon, 27 Aug 2018 10:46:20 -0400 Subject: [PATCH 2/4] Updated the message for skipping and added trailing comma --- pandas/compat/numpy/__init__.py | 2 +- pandas/tests/io/test_pytables.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py index d816b3a9659a2..cd4aaac538ca9 100644 --- a/pandas/compat/numpy/__init__.py +++ b/pandas/compat/numpy/__init__.py @@ -76,5 +76,5 @@ def np_array_datetime64_compat(arr, *args, **kwargs): '_np_version_under1p13', '_np_version_under1p14', '_np_version_under1p15', - '_np_version_equal1p15' + '_np_version_equal1p15', ] diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 11c9219df5403..fcbb0234ea02f 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -2193,8 +2193,8 @@ def test_unimplemented_dtypes_table_columns(self): @pytest.mark.skipif( _np_version_equal1p15, - reason=("pytables conda build package needs build " - "with numpy 1.15: gh-22098")) + reason=("Skipping pytables test when numpy version is " + "exactly equal to 1.15: gh-22098")) def test_calendar_roundtrip_issue(self): # 8591 From d6cba4c9a74d48855b0503d4e05bb45b873cc8ab Mon Sep 17 00:00:00 2001 From: NikhilKumarM <33mnikhilkumar@gmail.com> Date: Tue, 28 Aug 2018 08:48:08 -0400 Subject: [PATCH 3/4] Explicitly checking numpy version 1.15 for pytables test --- pandas/compat/numpy/__init__.py | 5 ++--- pandas/tests/io/test_pytables.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py index cd4aaac538ca9..a6f586c7f2638 100644 --- a/pandas/compat/numpy/__init__.py +++ b/pandas/compat/numpy/__init__.py @@ -15,7 +15,7 @@ _np_version_under1p13 = _nlv < LooseVersion('1.13') _np_version_under1p14 = _nlv < LooseVersion('1.14') _np_version_under1p15 = _nlv < LooseVersion('1.15') -_np_version_equal1p15 = _nlv == LooseVersion('1.15') + if _nlv < '1.9': raise ImportError('this version of pandas is incompatible with ' @@ -75,6 +75,5 @@ def np_array_datetime64_compat(arr, *args, **kwargs): '_np_version_under1p12', '_np_version_under1p13', '_np_version_under1p14', - '_np_version_under1p15', - '_np_version_equal1p15', + '_np_version_under1p15' ] diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index fcbb0234ea02f..9ae4a0cda9f02 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -14,7 +14,7 @@ from pandas import (Series, DataFrame, Panel, MultiIndex, Int64Index, RangeIndex, Categorical, bdate_range, date_range, timedelta_range, Index, DatetimeIndex, - isna, compat, concat, Timestamp, _np_version_equal1p15) + isna, compat, concat, Timestamp) import pandas.util.testing as tm import pandas.util._test_decorators as td @@ -2192,7 +2192,7 @@ def test_unimplemented_dtypes_table_columns(self): pytest.raises(TypeError, store.append, 'df_unimplemented', df) @pytest.mark.skipif( - _np_version_equal1p15, + LooseVersion(np.__version__) == LooseVersion('1.15'), reason=("Skipping pytables test when numpy version is " "exactly equal to 1.15: gh-22098")) def test_calendar_roundtrip_issue(self): From 3337b748806b46a96198e999b236de4cd332541b Mon Sep 17 00:00:00 2001 From: NikhilKumarM <33mnikhilkumar@gmail.com> Date: Wed, 29 Aug 2018 10:10:49 -0400 Subject: [PATCH 4/4] Changed LooseVersion(1.15) to LooseVersion(1.15.0) --- pandas/tests/io/test_pytables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 9ae4a0cda9f02..ddcfcc0842d1a 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -2192,9 +2192,9 @@ def test_unimplemented_dtypes_table_columns(self): pytest.raises(TypeError, store.append, 'df_unimplemented', df) @pytest.mark.skipif( - LooseVersion(np.__version__) == LooseVersion('1.15'), + LooseVersion(np.__version__) == LooseVersion('1.15.0'), reason=("Skipping pytables test when numpy version is " - "exactly equal to 1.15: gh-22098")) + "exactly equal to 1.15.0: gh-22098")) def test_calendar_roundtrip_issue(self): # 8591