1010from feather import FeatherError
1111from pandas .util .testing import assert_frame_equal , ensure_clean
1212import 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