4
4
import numpy as np
5
5
import pytest
6
6
7
- import pandas .util ._test_decorators as td
8
-
9
7
import pandas as pd
10
8
import pandas .util .testing as tm
11
9
from pandas .util .testing import assert_frame_equal , ensure_clean
16
14
17
15
18
16
pyarrow_version = LooseVersion (pyarrow .__version__ )
17
+ filter_sparse = pytest .mark .filterwarnings ("ignore:The Sparse" )
19
18
20
19
20
+ @filter_sparse
21
21
@pytest .mark .single
22
22
class TestFeather :
23
23
def check_error_on_write (self , df , exc ):
@@ -50,7 +50,6 @@ def test_error(self):
50
50
]:
51
51
self .check_error_on_write (obj , ValueError )
52
52
53
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
54
53
def test_basic (self ):
55
54
56
55
df = pd .DataFrame (
@@ -77,7 +76,6 @@ def test_basic(self):
77
76
assert df .dttz .dtype .tz .zone == "US/Eastern"
78
77
self .check_round_trip (df )
79
78
80
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
81
79
def test_duplicate_columns (self ):
82
80
83
81
# https://github.com/wesm/feather/issues/53
@@ -90,7 +88,6 @@ def test_stringify_columns(self):
90
88
df = pd .DataFrame (np .arange (12 ).reshape (4 , 3 )).copy ()
91
89
self .check_error_on_write (df , ValueError )
92
90
93
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
94
91
def test_read_columns (self ):
95
92
# GH 24025
96
93
df = pd .DataFrame (
@@ -111,7 +108,6 @@ def test_unsupported_other(self):
111
108
# Some versions raise ValueError, others raise ArrowInvalid.
112
109
self .check_error_on_write (df , Exception )
113
110
114
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
115
111
def test_rw_nthreads (self ):
116
112
df = pd .DataFrame ({"A" : np .arange (100000 )})
117
113
expected_warning = (
@@ -129,13 +125,11 @@ def test_rw_nthreads(self):
129
125
# we have an extra FutureWarnings because of #GH23752
130
126
assert any (expected_warning in str (x ) for x in w )
131
127
132
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
133
128
def test_rw_use_threads (self ):
134
129
df = pd .DataFrame ({"A" : np .arange (100000 )})
135
130
self .check_round_trip (df , use_threads = True )
136
131
self .check_round_trip (df , use_threads = False )
137
132
138
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
139
133
def test_write_with_index (self ):
140
134
141
135
df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
@@ -163,13 +157,11 @@ def test_write_with_index(self):
163
157
df .columns = (pd .MultiIndex .from_tuples ([("a" , 1 ), ("a" , 2 ), ("b" , 1 )]),)
164
158
self .check_error_on_write (df , ValueError )
165
159
166
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
167
160
def test_path_pathlib (self ):
168
161
df = tm .makeDataFrame ().reset_index ()
169
162
result = tm .round_trip_pathlib (df .to_feather , pd .read_feather )
170
163
tm .assert_frame_equal (df , result )
171
164
172
- @td .skip_if_no ("pyarrow" , "0.15.0" ) # Sparse removal
173
165
def test_path_localpath (self ):
174
166
df = tm .makeDataFrame ().reset_index ()
175
167
result = tm .round_trip_localpath (df .to_feather , pd .read_feather )
0 commit comments