10
10
from feather import FeatherError
11
11
from pandas .util .testing import assert_frame_equal , ensure_clean
12
12
import pandas .util .testing as tm
13
+ from distutils .version import LooseVersion
14
+
15
+
16
+ fv = LooseVersion (feather .__version__ )
13
17
14
18
15
19
@pytest .mark .single
@@ -57,6 +61,7 @@ def test_basic(self):
57
61
assert df .dttz .dtype .tz .zone == 'US/Eastern'
58
62
self .check_round_trip (df )
59
63
64
+ @pytest .mark .skipif (fv >= '0.4.0' , reason = 'fixed in 0.4.0' )
60
65
def test_strided_data_issues (self ):
61
66
62
67
# strided data issuehttps://github.com/wesm/feather/issues/97
@@ -76,19 +81,23 @@ def test_stringify_columns(self):
76
81
df = pd .DataFrame (np .arange (12 ).reshape (4 , 3 )).copy ()
77
82
self .check_error_on_write (df , ValueError )
78
83
84
+ @pytest .mark .skipif (fv >= '0.4.0' , reason = 'fixed in 0.4.0' )
79
85
def test_unsupported (self ):
80
86
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
85
88
df = pd .DataFrame ({'a' : pd .timedelta_range ('1 day' , periods = 3 )})
86
89
self .check_error_on_write (df , FeatherError )
87
90
88
91
# non-strings
89
92
df = pd .DataFrame ({'a' : ['a' , 1 , 2.0 ]})
90
93
self .check_error_on_write (df , ValueError )
91
94
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
+
92
101
def test_write_with_index (self ):
93
102
94
103
df = pd .DataFrame ({'A' : [1 , 2 , 3 ]})
0 commit comments