16
16
pytestmark = pytest .mark .filterwarnings (
17
17
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
18
18
)
19
- xfail_pyarrow = pytest .mark .usefixtures ("pyarrow_xfail" )
20
19
21
20
22
21
@pytest .fixture
@@ -33,7 +32,6 @@ def custom_dialect():
33
32
return dialect_name , dialect_kwargs
34
33
35
34
36
- @xfail_pyarrow # ValueError: The 'dialect' option is not supported
37
35
def test_dialect (all_parsers ):
38
36
parser = all_parsers
39
37
data = """\
@@ -44,6 +42,13 @@ def test_dialect(all_parsers):
44
42
45
43
dia = csv .excel ()
46
44
dia .quoting = csv .QUOTE_NONE
45
+
46
+ if parser .engine == "pyarrow" :
47
+ msg = "The 'dialect' option is not supported with the 'pyarrow' engine"
48
+ with pytest .raises (ValueError , match = msg ):
49
+ parser .read_csv (StringIO (data ), dialect = dia )
50
+ return
51
+
47
52
df = parser .read_csv (StringIO (data ), dialect = dia )
48
53
49
54
data = """\
@@ -56,7 +61,6 @@ def test_dialect(all_parsers):
56
61
tm .assert_frame_equal (df , exp )
57
62
58
63
59
- @xfail_pyarrow # ValueError: The 'dialect' option is not supported
60
64
def test_dialect_str (all_parsers ):
61
65
dialect_name = "mydialect"
62
66
parser = all_parsers
@@ -68,6 +72,12 @@ def test_dialect_str(all_parsers):
68
72
exp = DataFrame ({"fruit" : ["apple" , "pear" ], "vegetable" : ["broccoli" , "tomato" ]})
69
73
70
74
with tm .with_csv_dialect (dialect_name , delimiter = ":" ):
75
+ if parser .engine == "pyarrow" :
76
+ msg = "The 'dialect' option is not supported with the 'pyarrow' engine"
77
+ with pytest .raises (ValueError , match = msg ):
78
+ parser .read_csv (StringIO (data ), dialect = dialect_name )
79
+ return
80
+
71
81
df = parser .read_csv (StringIO (data ), dialect = dialect_name )
72
82
tm .assert_frame_equal (df , exp )
73
83
@@ -84,7 +94,6 @@ class InvalidDialect:
84
94
parser .read_csv (StringIO (data ), dialect = InvalidDialect )
85
95
86
96
87
- @xfail_pyarrow # ValueError: The 'dialect' option is not supported
88
97
@pytest .mark .parametrize (
89
98
"arg" ,
90
99
[None , "doublequote" , "escapechar" , "skipinitialspace" , "quotechar" , "quoting" ],
@@ -114,6 +123,18 @@ def test_dialect_conflict_except_delimiter(all_parsers, custom_dialect, arg, val
114
123
kwds [arg ] = "blah"
115
124
116
125
with tm .with_csv_dialect (dialect_name , ** dialect_kwargs ):
126
+ if parser .engine == "pyarrow" :
127
+ msg = "The 'dialect' option is not supported with the 'pyarrow' engine"
128
+ with pytest .raises (ValueError , match = msg ):
129
+ parser .read_csv_check_warnings (
130
+ # No warning bc we raise
131
+ None ,
132
+ "Conflicting values for" ,
133
+ StringIO (data ),
134
+ dialect = dialect_name ,
135
+ ** kwds ,
136
+ )
137
+ return
117
138
result = parser .read_csv_check_warnings (
118
139
warning_klass ,
119
140
"Conflicting values for" ,
@@ -124,7 +145,6 @@ def test_dialect_conflict_except_delimiter(all_parsers, custom_dialect, arg, val
124
145
tm .assert_frame_equal (result , expected )
125
146
126
147
127
- @xfail_pyarrow # ValueError: The 'dialect' option is not supported
128
148
@pytest .mark .parametrize (
129
149
"kwargs,warning_klass" ,
130
150
[
@@ -153,6 +173,18 @@ def test_dialect_conflict_delimiter(all_parsers, custom_dialect, kwargs, warning
153
173
data = "a:b\n 1:2"
154
174
155
175
with tm .with_csv_dialect (dialect_name , ** dialect_kwargs ):
176
+ if parser .engine == "pyarrow" :
177
+ msg = "The 'dialect' option is not supported with the 'pyarrow' engine"
178
+ with pytest .raises (ValueError , match = msg ):
179
+ parser .read_csv_check_warnings (
180
+ # no warning bc we raise
181
+ None ,
182
+ "Conflicting values for 'delimiter'" ,
183
+ StringIO (data ),
184
+ dialect = dialect_name ,
185
+ ** kwargs ,
186
+ )
187
+ return
156
188
result = parser .read_csv_check_warnings (
157
189
warning_klass ,
158
190
"Conflicting values for 'delimiter'" ,
0 commit comments