Skip to content

Commit af8bfec

Browse files
committed
Update test for on_bad_lines
1 parent fd482e8 commit af8bfec

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/tests/io/parser/test_unsupported.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,17 @@ def test_pyarrow_engine(self):
156156
with pytest.raises(ValueError, match=msg):
157157
read_csv(StringIO(data), engine="pyarrow", **kwargs)
158158

159-
def test_on_bad_lines_callable_python_only(self, all_parsers):
159+
def test_on_bad_lines_callable_python_or_pyarrow(self, all_parsers):
160160
# GH 5686
161+
# GH 54643
161162
sio = StringIO("a,b\n1,2")
162163
bad_lines_func = lambda x: x
163164
parser = all_parsers
164-
if all_parsers.engine != "python":
165-
msg = "on_bad_line can only be a callable function if engine='python'"
165+
if all_parsers.engine not in ["python", "pyarrow"]:
166+
msg = (
167+
"on_bad_line can only be a callable "
168+
"function if engine='python' or 'pyarrow'"
169+
)
166170
with pytest.raises(ValueError, match=msg):
167171
parser.read_csv(sio, on_bad_lines=bad_lines_func)
168172
else:

0 commit comments

Comments
 (0)