From f3d30989edfd5c6adf93c2e18d49dbdad3bcf8cd Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Wed, 24 May 2017 06:13:14 -0400 Subject: [PATCH] COMPAT: feather-format 0.4.0 compat --- ci/requirements-3.5_OSX.sh | 2 +- pandas/tests/io/test_feather.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ci/requirements-3.5_OSX.sh b/ci/requirements-3.5_OSX.sh index cfbd2882a8a2d..39ea1a0cf67bf 100644 --- a/ci/requirements-3.5_OSX.sh +++ b/ci/requirements-3.5_OSX.sh @@ -4,4 +4,4 @@ source activate pandas echo "install 35_OSX" -conda install -n pandas -c conda-forge feather-format +conda install -n pandas -c conda-forge feather-format==0.3.1 diff --git a/pandas/tests/io/test_feather.py b/pandas/tests/io/test_feather.py index 948ab736af6c6..42ad9d3e0d8fe 100644 --- a/pandas/tests/io/test_feather.py +++ b/pandas/tests/io/test_feather.py @@ -10,6 +10,10 @@ from feather import FeatherError from pandas.util.testing import assert_frame_equal, ensure_clean import pandas.util.testing as tm +from distutils.version import LooseVersion + + +fv = LooseVersion(feather.__version__) @pytest.mark.single @@ -57,6 +61,7 @@ def test_basic(self): assert df.dttz.dtype.tz.zone == 'US/Eastern' self.check_round_trip(df) + @pytest.mark.skipif(fv >= '0.4.0', reason='fixed in 0.4.0') def test_strided_data_issues(self): # strided data issuehttps://github.com/wesm/feather/issues/97 @@ -76,12 +81,10 @@ def test_stringify_columns(self): df = pd.DataFrame(np.arange(12).reshape(4, 3)).copy() self.check_error_on_write(df, ValueError) + @pytest.mark.skipif(fv >= '0.4.0', reason='fixed in 0.4.0') def test_unsupported(self): - # period - df = pd.DataFrame({'a': pd.period_range('2013', freq='M', periods=3)}) - self.check_error_on_write(df, ValueError) - + # timedelta df = pd.DataFrame({'a': pd.timedelta_range('1 day', periods=3)}) self.check_error_on_write(df, FeatherError) @@ -89,6 +92,12 @@ def test_unsupported(self): df = pd.DataFrame({'a': ['a', 1, 2.0]}) self.check_error_on_write(df, ValueError) + def test_unsupported_other(self): + + # period + df = pd.DataFrame({'a': pd.period_range('2013', freq='M', periods=3)}) + self.check_error_on_write(df, ValueError) + def test_write_with_index(self): df = pd.DataFrame({'A': [1, 2, 3]})