From 0d0924dd03343eb9d663f9dfb10ad0869f3bc7ec Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sat, 14 Oct 2017 15:27:53 -0400 Subject: [PATCH 1/5] TST: clean up some test warnings --- pandas/tests/io/test_gbq.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/tests/io/test_gbq.py b/pandas/tests/io/test_gbq.py index 8f20fb2e75c8a..58a84ad4d47f8 100644 --- a/pandas/tests/io/test_gbq.py +++ b/pandas/tests/io/test_gbq.py @@ -92,7 +92,6 @@ def make_mixed_dataframe_v2(test_size): index=range(test_size)) -@pytest.mark.xfail(reason="gbq having issues") @pytest.mark.single class TestToGBQIntegrationWithServiceAccountKeyPath(object): From a7a3a4e02763349ebc11c37614724dd6d9e079d2 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sat, 14 Oct 2017 15:53:31 -0400 Subject: [PATCH 2/5] TST: moar warnings --- ci/requirements-3.5.pip | 1 + ci/requirements-3.5.run | 1 - ci/requirements-3.6.pip | 1 + ci/requirements-3.6.run | 1 - ci/requirements-3.6_LOCALE.pip | 1 + ci/requirements-3.6_LOCALE.run | 1 - pandas/tests/test_algos.py | 2 +- 7 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/requirements-3.5.pip b/ci/requirements-3.5.pip index 6e4f7b65f9728..14d6a2f552d0c 100644 --- a/ci/requirements-3.5.pip +++ b/ci/requirements-3.5.pip @@ -1,2 +1,3 @@ +ipython xarray==0.9.1 pandas-gbq diff --git a/ci/requirements-3.5.run b/ci/requirements-3.5.run index 52828b5220997..9d4c9ea47e146 100644 --- a/ci/requirements-3.5.run +++ b/ci/requirements-3.5.run @@ -17,4 +17,3 @@ pymysql psycopg2 s3fs beautifulsoup4 -ipython diff --git a/ci/requirements-3.6.pip b/ci/requirements-3.6.pip index 753a60d6c119a..05b79624af614 100644 --- a/ci/requirements-3.6.pip +++ b/ci/requirements-3.6.pip @@ -1 +1,2 @@ brotlipy +ipython diff --git a/ci/requirements-3.6.run b/ci/requirements-3.6.run index 822144a80bc9a..eb5ad7e001a39 100644 --- a/ci/requirements-3.6.run +++ b/ci/requirements-3.6.run @@ -22,4 +22,3 @@ fastparquet beautifulsoup4 s3fs xarray -ipython diff --git a/ci/requirements-3.6_LOCALE.pip b/ci/requirements-3.6_LOCALE.pip index e69de29bb2d1d..49a7ffe2a956b 100644 --- a/ci/requirements-3.6_LOCALE.pip +++ b/ci/requirements-3.6_LOCALE.pip @@ -0,0 +1 @@ +ipython diff --git a/ci/requirements-3.6_LOCALE.run b/ci/requirements-3.6_LOCALE.run index ad54284c6f7e3..78d89a29c7c19 100644 --- a/ci/requirements-3.6_LOCALE.run +++ b/ci/requirements-3.6_LOCALE.run @@ -19,4 +19,3 @@ psycopg2 beautifulsoup4 s3fs xarray -ipython diff --git a/pandas/tests/test_algos.py b/pandas/tests/test_algos.py index 3694bba594adb..38625bfb29917 100644 --- a/pandas/tests/test_algos.py +++ b/pandas/tests/test_algos.py @@ -765,7 +765,7 @@ def test_duplicated_with_nas(self): 2, 4, 1, 5, 6]), np.array([1.1, 2.2, 1.1, np.nan, 3.3, 2.2, 4.4, 1.1, np.nan, 6.6]), - pytest.mark.xfail(resaon="Complex bug. GH 16399")( + pytest.mark.xfail(reason="Complex bug. GH 16399")( np.array([1 + 1j, 2 + 2j, 1 + 1j, 5 + 5j, 3 + 3j, 2 + 2j, 4 + 4j, 1 + 1j, 5 + 5j, 6 + 6j]) ), From bbce56ee4c0d7022ffb0e4574ad5ac2bcc8069b8 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sat, 14 Oct 2017 16:03:58 -0400 Subject: [PATCH 3/5] struct array comparision warnings --- pandas/core/dtypes/missing.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandas/core/dtypes/missing.py b/pandas/core/dtypes/missing.py index 49b7b1d1d3a9b..d8973dd2eb27a 100644 --- a/pandas/core/dtypes/missing.py +++ b/pandas/core/dtypes/missing.py @@ -327,6 +327,12 @@ def array_equivalent(left, right, strict_nan=False): left = left.view('i8') right = right.view('i8') + # if we have structured dtypes, compare first + if (left.dtype.type is np.void or + right.dtype.type is np.void): + if left.dtype != right.dtype: + return False + return np.array_equal(left, right) From e9fd1dcbaebd5507bbf36087db6e6382e3e27f7b Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sat, 14 Oct 2017 16:35:47 -0400 Subject: [PATCH 4/5] clean up some pytables tests --- pandas/tests/io/test_pytables.py | 53 ++++++-------------------------- 1 file changed, 10 insertions(+), 43 deletions(-) diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 6e3e338ce3de3..a97747b93369f 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -1,5 +1,4 @@ import pytest -import sys import os import tempfile from contextlib import contextmanager @@ -16,7 +15,8 @@ date_range, timedelta_range, Index, DatetimeIndex, isna) -from pandas.compat import is_platform_windows, PY3, PY35, BytesIO, text_type +from pandas.compat import (is_platform_windows, is_platform_little_endian, + PY3, PY35, PY36, BytesIO, text_type) from pandas.io.formats.printing import pprint_thing from pandas.core.dtypes.common import is_categorical_dtype @@ -1042,11 +1042,10 @@ def check(format, index): with catch_warnings(record=True): check('fixed', index) + @pytest.mark.skipif(not is_platform_little_endian(), + reason="reason platform is not little endian") def test_encoding(self): - if sys.byteorder != 'little': - pytest.skip('system byteorder is not little') - with ensure_clean_store(self.path) as store: df = DataFrame(dict(A='foo', B='bar'), index=range(5)) df.loc[2, 'A'] = np.nan @@ -2887,9 +2886,6 @@ def test_index_types(self): def test_timeseries_preepoch(self): - if sys.version_info[0] == 2 and sys.version_info[1] < 7: - pytest.skip("won't work on Python < 2.7") - dr = bdate_range('1/1/1940', '1/1/1960') ts = Series(np.random.randn(len(dr)), index=dr) try: @@ -4274,13 +4270,11 @@ def test_select_as_multiple(self): ['df1', 'df3'], where=['A>0', 'B>0'], selector='df1') + @pytest.mark.skipf( + LooseVersion(tables.__version__) < '3.1.0', + "tables version does not support fix for nan selection bug: GH 4858") def test_nan_selection_bug_4858(self): - # GH 4858; nan selection bug, only works for pytables >= 3.1 - if LooseVersion(tables.__version__) < '3.1.0': - pytest.skip('tables version does not support fix for nan ' - 'selection bug: GH 4858') - with ensure_clean_store(self.path) as store: df = DataFrame(dict(cols=range(6), values=range(6)), @@ -4598,11 +4592,9 @@ def test_pytables_native_read(self): d2 = store['detector/readout'] assert isinstance(d2, DataFrame) + @pytest.mark.skipif(PY35 and is_platform_windows(), + reason="native2 read fails oddly on windows / 3.5") def test_pytables_native2_read(self): - # fails on win/3.5 oddly - if PY35 and is_platform_windows(): - pytest.skip("native2 read fails oddly on windows / 3.5") - with ensure_clean_store( tm.get_data_path('legacy_hdf/pytables_native2.h5'), mode='r') as store: @@ -4690,31 +4682,6 @@ def do_copy(f, new_f=None, keys=None, finally: safe_remove(path) - def test_legacy_table_write(self): - pytest.skip("cannot write legacy tables") - - store = HDFStore(tm.get_data_path( - 'legacy_hdf/legacy_table_%s.h5' % pandas.__version__), 'a') - - df = tm.makeDataFrame() - with catch_warnings(record=True): - wp = tm.makePanel() - - index = MultiIndex(levels=[['foo', 'bar', 'baz', 'qux'], - ['one', 'two', 'three']], - labels=[[0, 0, 0, 1, 1, 2, 2, 3, 3, 3], - [0, 1, 2, 0, 1, 1, 2, 0, 1, 2]], - names=['foo', 'bar']) - df = DataFrame(np.random.randn(10, 3), index=index, - columns=['A', 'B', 'C']) - store.append('mi', df) - - df = DataFrame(dict(A='foo', B='bar'), index=lrange(10)) - store.append('df', df, data_columns=['B'], min_itemsize={'A': 200}) - store.append('wp', wp) - - store.close() - def test_store_datetime_fractional_secs(self): with ensure_clean_store(self.path) as store: @@ -5260,7 +5227,7 @@ def test_read_hdf_series_mode_r(self, format): result = pd.read_hdf(path, key='data', mode='r') tm.assert_series_equal(result, series) - @pytest.mark.skipif(sys.version_info < (3, 6), reason="Need python 3.6") + @pytest.mark.skipif(not PY36, reason="Need python 3.6") def test_fspath(self): with tm.ensure_clean('foo.h5') as path: with pd.HDFStore(path) as store: From 93cbec87ae9c7295db4922ae6fd6d9ec4d1458d5 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sat, 14 Oct 2017 16:38:58 -0400 Subject: [PATCH 5/5] revert ipython --- ci/requirements-3.5.pip | 1 - ci/requirements-3.5.run | 1 + ci/requirements-3.6.pip | 1 - ci/requirements-3.6.run | 1 + ci/requirements-3.6_LOCALE.pip | 1 - ci/requirements-3.6_LOCALE.run | 1 + 6 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/requirements-3.5.pip b/ci/requirements-3.5.pip index 14d6a2f552d0c..6e4f7b65f9728 100644 --- a/ci/requirements-3.5.pip +++ b/ci/requirements-3.5.pip @@ -1,3 +1,2 @@ -ipython xarray==0.9.1 pandas-gbq diff --git a/ci/requirements-3.5.run b/ci/requirements-3.5.run index 9d4c9ea47e146..52828b5220997 100644 --- a/ci/requirements-3.5.run +++ b/ci/requirements-3.5.run @@ -17,3 +17,4 @@ pymysql psycopg2 s3fs beautifulsoup4 +ipython diff --git a/ci/requirements-3.6.pip b/ci/requirements-3.6.pip index 05b79624af614..753a60d6c119a 100644 --- a/ci/requirements-3.6.pip +++ b/ci/requirements-3.6.pip @@ -1,2 +1 @@ brotlipy -ipython diff --git a/ci/requirements-3.6.run b/ci/requirements-3.6.run index eb5ad7e001a39..822144a80bc9a 100644 --- a/ci/requirements-3.6.run +++ b/ci/requirements-3.6.run @@ -22,3 +22,4 @@ fastparquet beautifulsoup4 s3fs xarray +ipython diff --git a/ci/requirements-3.6_LOCALE.pip b/ci/requirements-3.6_LOCALE.pip index 49a7ffe2a956b..e69de29bb2d1d 100644 --- a/ci/requirements-3.6_LOCALE.pip +++ b/ci/requirements-3.6_LOCALE.pip @@ -1 +0,0 @@ -ipython diff --git a/ci/requirements-3.6_LOCALE.run b/ci/requirements-3.6_LOCALE.run index 78d89a29c7c19..ad54284c6f7e3 100644 --- a/ci/requirements-3.6_LOCALE.run +++ b/ci/requirements-3.6_LOCALE.run @@ -19,3 +19,4 @@ psycopg2 beautifulsoup4 s3fs xarray +ipython