Skip to content

Commit 5437d7a

Browse files
authored
TST: Skip more pyarrow csv tests that fail in pyarrow.csv.read_csv (#56098)
1 parent b6834f8 commit 5437d7a

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

pandas/tests/io/parser/common/test_read_errors.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ def test_error_bad_lines(all_parsers):
186186
msg = "Expected 1 fields in line 3, saw 3"
187187

188188
if parser.engine == "pyarrow":
189-
msg = "CSV parse error: Expected 1 columns, got 3: 1,2,3"
189+
# "CSV parse error: Expected 1 columns, got 3: 1,2,3"
190+
pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
190191

191192
with pytest.raises(ParserError, match=msg):
192193
parser.read_csv(StringIO(data), on_bad_lines="error")
@@ -222,7 +223,8 @@ def test_read_csv_wrong_num_columns(all_parsers):
222223
msg = "Expected 6 fields in line 3, saw 7"
223224

224225
if parser.engine == "pyarrow":
225-
msg = "Expected 6 columns, got 7: 6,7,8,9,10,11,12"
226+
# Expected 6 columns, got 7: 6,7,8,9,10,11,12
227+
pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
226228

227229
with pytest.raises(ParserError, match=msg):
228230
parser.read_csv(StringIO(data))
@@ -246,10 +248,9 @@ def test_null_byte_char(request, all_parsers):
246248
tm.assert_frame_equal(out, expected)
247249
else:
248250
if parser.engine == "pyarrow":
249-
msg = (
250-
"CSV parse error: Empty CSV file or block: "
251-
"cannot infer number of columns"
252-
)
251+
# CSV parse error: Empty CSV file or block: "
252+
# cannot infer number of columns"
253+
pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
253254
else:
254255
msg = "NULL byte detected"
255256
with pytest.raises(ParserError, match=msg):
@@ -299,7 +300,8 @@ def test_bad_header_uniform_error(all_parsers):
299300
"number of columns, but 3 left to parse."
300301
)
301302
elif parser.engine == "pyarrow":
302-
msg = "CSV parse error: Expected 1 columns, got 4: col1,col2,col3,col4"
303+
# "CSV parse error: Expected 1 columns, got 4: col1,col2,col3,col4"
304+
pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
303305

304306
with pytest.raises(ParserError, match=msg):
305307
parser.read_csv(StringIO(data), index_col=0, on_bad_lines="error")

pandas/tests/io/parser/test_unsupported.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def test_close_file_handle_on_invalid_usecols(all_parsers):
178178

179179
error = ValueError
180180
if parser.engine == "pyarrow":
181-
pyarrow = pytest.importorskip("pyarrow")
182-
error = pyarrow.lib.ArrowKeyError
181+
# Raises pyarrow.lib.ArrowKeyError
182+
pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
183183

184184
with tm.ensure_clean("test.csv") as fname:
185185
Path(fname).write_text("col1,col2\na,b\n1,2", encoding="utf-8")

pandas/tests/io/parser/usecols/test_usecols_basic.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,8 @@ def test_usecols_subset_names_mismatch_orig_columns(all_parsers, usecols, reques
477477
with pytest.raises(ValueError, match=_msg_pyarrow_requires_names):
478478
parser.read_csv(StringIO(data), header=0, names=names, usecols=usecols)
479479
return
480-
mark = pytest.mark.xfail(
481-
reason="pyarrow.lib.ArrowKeyError: Column 'A' in include_columns "
482-
"does not exist"
483-
)
484-
request.applymarker(mark)
480+
# "pyarrow.lib.ArrowKeyError: Column 'A' in include_columns does not exist"
481+
pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
485482

486483
result = parser.read_csv(StringIO(data), header=0, names=names, usecols=usecols)
487484
expected = DataFrame({"A": [1, 5], "C": [3, 7]})

0 commit comments

Comments
 (0)