Skip to content

Commit 692a5b9

Browse files
authored
COMPAT: feather-format 0.4.0 compat (#16475)
1 parent 044feb5 commit 692a5b9

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

ci/requirements-3.5_OSX.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source activate pandas
44

55
echo "install 35_OSX"
66

7-
conda install -n pandas -c conda-forge feather-format
7+
conda install -n pandas -c conda-forge feather-format==0.3.1

pandas/tests/io/test_feather.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from feather import FeatherError
1111
from pandas.util.testing import assert_frame_equal, ensure_clean
1212
import pandas.util.testing as tm
13+
from distutils.version import LooseVersion
14+
15+
16+
fv = LooseVersion(feather.__version__)
1317

1418

1519
@pytest.mark.single
@@ -57,6 +61,7 @@ def test_basic(self):
5761
assert df.dttz.dtype.tz.zone == 'US/Eastern'
5862
self.check_round_trip(df)
5963

64+
@pytest.mark.skipif(fv >= '0.4.0', reason='fixed in 0.4.0')
6065
def test_strided_data_issues(self):
6166

6267
# strided data issuehttps://github.com/wesm/feather/issues/97
@@ -76,19 +81,23 @@ def test_stringify_columns(self):
7681
df = pd.DataFrame(np.arange(12).reshape(4, 3)).copy()
7782
self.check_error_on_write(df, ValueError)
7883

84+
@pytest.mark.skipif(fv >= '0.4.0', reason='fixed in 0.4.0')
7985
def test_unsupported(self):
8086

81-
# period
82-
df = pd.DataFrame({'a': pd.period_range('2013', freq='M', periods=3)})
83-
self.check_error_on_write(df, ValueError)
84-
87+
# timedelta
8588
df = pd.DataFrame({'a': pd.timedelta_range('1 day', periods=3)})
8689
self.check_error_on_write(df, FeatherError)
8790

8891
# non-strings
8992
df = pd.DataFrame({'a': ['a', 1, 2.0]})
9093
self.check_error_on_write(df, ValueError)
9194

95+
def test_unsupported_other(self):
96+
97+
# period
98+
df = pd.DataFrame({'a': pd.period_range('2013', freq='M', periods=3)})
99+
self.check_error_on_write(df, ValueError)
100+
92101
def test_write_with_index(self):
93102

94103
df = pd.DataFrame({'A': [1, 2, 3]})

0 commit comments

Comments
 (0)