@@ -119,7 +119,6 @@ def test_read_csv_local(all_parsers, csv1):
119
119
tm .assert_frame_equal (result , expected )
120
120
121
121
122
- @xfail_pyarrow
123
122
def test_1000_sep (all_parsers ):
124
123
parser = all_parsers
125
124
data = """A|B|C
@@ -128,6 +127,12 @@ def test_1000_sep(all_parsers):
128
127
"""
129
128
expected = DataFrame ({"A" : [1 , 10 ], "B" : [2334 , 13 ], "C" : [5 , 10.0 ]})
130
129
130
+ if parser .engine == "pyarrow" :
131
+ msg = "The 'thousands' option is not supported with the 'pyarrow' engine"
132
+ with pytest .raises (ValueError , match = msg ):
133
+ parser .read_csv (StringIO (data ), sep = "|" , thousands = "," )
134
+ return
135
+
131
136
result = parser .read_csv (StringIO (data ), sep = "|" , thousands = "," )
132
137
tm .assert_frame_equal (result , expected )
133
138
@@ -161,7 +166,6 @@ def test_csv_mixed_type(all_parsers):
161
166
tm .assert_frame_equal (result , expected )
162
167
163
168
164
- @xfail_pyarrow
165
169
def test_read_csv_low_memory_no_rows_with_index (all_parsers ):
166
170
# see gh-21141
167
171
parser = all_parsers
@@ -174,6 +178,13 @@ def test_read_csv_low_memory_no_rows_with_index(all_parsers):
174
178
2,2,3,4
175
179
3,3,4,5
176
180
"""
181
+
182
+ if parser .engine == "pyarrow" :
183
+ msg = "The 'nrows' option is not supported with the 'pyarrow' engine"
184
+ with pytest .raises (ValueError , match = msg ):
185
+ parser .read_csv (StringIO (data ), low_memory = True , index_col = 0 , nrows = 0 )
186
+ return
187
+
177
188
result = parser .read_csv (StringIO (data ), low_memory = True , index_col = 0 , nrows = 0 )
178
189
expected = DataFrame (columns = ["A" , "B" , "C" ])
179
190
tm .assert_frame_equal (result , expected )
@@ -212,7 +223,6 @@ def test_read_csv_dataframe(all_parsers, csv1):
212
223
tm .assert_frame_equal (result , expected )
213
224
214
225
215
- @xfail_pyarrow
216
226
@pytest .mark .parametrize ("nrows" , [3 , 3.0 ])
217
227
def test_read_nrows (all_parsers , nrows ):
218
228
# see gh-10476
@@ -230,11 +240,16 @@ def test_read_nrows(all_parsers, nrows):
230
240
)
231
241
parser = all_parsers
232
242
243
+ if parser .engine == "pyarrow" :
244
+ msg = "The 'nrows' option is not supported with the 'pyarrow' engine"
245
+ with pytest .raises (ValueError , match = msg ):
246
+ parser .read_csv (StringIO (data ), nrows = nrows )
247
+ return
248
+
233
249
result = parser .read_csv (StringIO (data ), nrows = nrows )
234
250
tm .assert_frame_equal (result , expected )
235
251
236
252
237
- @xfail_pyarrow
238
253
@pytest .mark .parametrize ("nrows" , [1.2 , "foo" , - 1 ])
239
254
def test_read_nrows_bad (all_parsers , nrows ):
240
255
data = """index,A,B,C,D
@@ -247,6 +262,8 @@ def test_read_nrows_bad(all_parsers, nrows):
247
262
"""
248
263
msg = r"'nrows' must be an integer >=0"
249
264
parser = all_parsers
265
+ if parser .engine == "pyarrow" :
266
+ msg = "The 'nrows' option is not supported with the 'pyarrow' engine"
250
267
251
268
with pytest .raises (ValueError , match = msg ):
252
269
parser .read_csv (StringIO (data ), nrows = nrows )
@@ -277,7 +294,6 @@ def test_missing_trailing_delimiters(all_parsers):
277
294
tm .assert_frame_equal (result , expected )
278
295
279
296
280
- @xfail_pyarrow
281
297
def test_skip_initial_space (all_parsers ):
282
298
data = (
283
299
'"09-Apr-2012", "01:10:18.300", 2456026.548822908, 12849, '
@@ -289,6 +305,18 @@ def test_skip_initial_space(all_parsers):
289
305
)
290
306
parser = all_parsers
291
307
308
+ if parser .engine == "pyarrow" :
309
+ msg = "The 'skipinitialspace' option is not supported with the 'pyarrow' engine"
310
+ with pytest .raises (ValueError , match = msg ):
311
+ parser .read_csv (
312
+ StringIO (data ),
313
+ names = list (range (33 )),
314
+ header = None ,
315
+ na_values = ["-9999.0" ],
316
+ skipinitialspace = True ,
317
+ )
318
+ return
319
+
292
320
result = parser .read_csv (
293
321
StringIO (data ),
294
322
names = list (range (33 )),
@@ -437,7 +465,6 @@ def test_read_empty_with_usecols(all_parsers, data, kwargs, expected):
437
465
tm .assert_frame_equal (result , expected )
438
466
439
467
440
- @xfail_pyarrow
441
468
@pytest .mark .parametrize (
442
469
"kwargs,expected" ,
443
470
[
@@ -467,6 +494,12 @@ def test_trailing_spaces(all_parsers, kwargs, expected):
467
494
data = "A B C \n random line with trailing spaces \n skip\n 1,2,3\n 1,2.,4.\n random line with trailing tabs\t \t \t \n \n 5.1,NaN,10.0\n " # noqa: E501
468
495
parser = all_parsers
469
496
497
+ if parser .engine == "pyarrow" :
498
+ msg = "The 'delim_whitespace' option is not supported with the 'pyarrow' engine"
499
+ with pytest .raises (ValueError , match = msg ):
500
+ parser .read_csv (StringIO (data .replace ("," , " " )), ** kwargs )
501
+ return
502
+
470
503
result = parser .read_csv (StringIO (data .replace ("," , " " )), ** kwargs )
471
504
tm .assert_frame_equal (result , expected )
472
505
@@ -488,7 +521,6 @@ def test_read_filepath_or_buffer(all_parsers):
488
521
parser .read_csv (filepath_or_buffer = b"input" )
489
522
490
523
491
- @xfail_pyarrow
492
524
@pytest .mark .parametrize ("delim_whitespace" , [True , False ])
493
525
def test_single_char_leading_whitespace (all_parsers , delim_whitespace ):
494
526
# see gh-9710
@@ -501,6 +533,15 @@ def test_single_char_leading_whitespace(all_parsers, delim_whitespace):
501
533
b\n """
502
534
503
535
expected = DataFrame ({"MyColumn" : list ("abab" )})
536
+
537
+ if parser .engine == "pyarrow" :
538
+ msg = "The 'skipinitialspace' option is not supported with the 'pyarrow' engine"
539
+ with pytest .raises (ValueError , match = msg ):
540
+ parser .read_csv (
541
+ StringIO (data ), skipinitialspace = True , delim_whitespace = delim_whitespace
542
+ )
543
+ return
544
+
504
545
result = parser .read_csv (
505
546
StringIO (data ), skipinitialspace = True , delim_whitespace = delim_whitespace
506
547
)
@@ -688,7 +729,6 @@ def test_first_row_bom_unquoted(all_parsers):
688
729
tm .assert_frame_equal (result , expected )
689
730
690
731
691
- @xfail_pyarrow
692
732
@pytest .mark .parametrize ("nrows" , range (1 , 6 ))
693
733
def test_blank_lines_between_header_and_data_rows (all_parsers , nrows ):
694
734
# GH 28071
@@ -698,6 +738,15 @@ def test_blank_lines_between_header_and_data_rows(all_parsers, nrows):
698
738
)
699
739
csv = "\n header\n \n a,b\n \n \n 1,2\n \n 3,4"
700
740
parser = all_parsers
741
+
742
+ if parser .engine == "pyarrow" :
743
+ msg = "The 'nrows' option is not supported with the 'pyarrow' engine"
744
+ with pytest .raises (ValueError , match = msg ):
745
+ parser .read_csv (
746
+ StringIO (csv ), header = 3 , nrows = nrows , skip_blank_lines = False
747
+ )
748
+ return
749
+
701
750
df = parser .read_csv (StringIO (csv ), header = 3 , nrows = nrows , skip_blank_lines = False )
702
751
tm .assert_frame_equal (df , ref [:nrows ])
703
752
@@ -731,11 +780,16 @@ def test_read_csv_names_not_accepting_sets(all_parsers):
731
780
parser .read_csv (StringIO (data ), names = set ("QAZ" ))
732
781
733
782
734
- @xfail_pyarrow
735
783
def test_read_table_delim_whitespace_default_sep (all_parsers ):
736
784
# GH: 35958
737
785
f = StringIO ("a b c\n 1 -2 -3\n 4 5 6" )
738
786
parser = all_parsers
787
+
788
+ if parser .engine == "pyarrow" :
789
+ msg = "The 'delim_whitespace' option is not supported with the 'pyarrow' engine"
790
+ with pytest .raises (ValueError , match = msg ):
791
+ parser .read_table (f , delim_whitespace = True )
792
+ return
739
793
result = parser .read_table (f , delim_whitespace = True )
740
794
expected = DataFrame ({"a" : [1 , 4 ], "b" : [- 2 , 5 ], "c" : [- 3 , 6 ]})
741
795
tm .assert_frame_equal (result , expected )
0 commit comments