Skip to content

Commit 3483795

Browse files
committed
BUG-20591 specify error in test
1 parent 92e2d11 commit 3483795

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

doc/source/whatsnew/v0.24.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ Backwards incompatible API changes
330330
- :meth:`Series.str.cat` will now raise if `others` is a `set` (:issue:`23009`)
331331
- Passing scalar values to :class:`DatetimeIndex` or :class:`TimedeltaIndex` will now raise ``TypeError`` instead of ``ValueError`` (:issue:`23539`)
332332
- ``max_rows`` and ``max_cols`` parameters removed from :class:`HTMLFormatter` since truncation is handled by :class:`DataFrameFormatter` (:issue:`23818`)
333-
- :meth:`read_csv` will now throw a ``ValueError`` if a column with missing values is declared as having ``dtype`` ``bool`` (:issue:`20591`)
333+
- :meth:`read_csv` with C engine will now throw a ``ValueError`` if a column with missing values is declared as having ``dtype`` ``bool`` (:issue:`20591`)
334334

335335
.. _whatsnew_0240.api_breaking.deps:
336336

pandas/tests/io/parser/test_na_values.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@ def test_na_values_with_dtype_str_and_na_filter(all_parsers, na_filter):
423423
tm.assert_frame_equal(result, expected)
424424

425425

426-
@pytest.mark.xfail
427-
def test_cast_NA_to_bool_raises_error(all_parsers):
428-
parser = all_parsers
426+
def test_cast_NA_to_bool_raises_error(c_parser_only):
427+
parser = c_parser_only
429428
data = "false,1\n,1\ntrue,"
430-
431-
parser.read_csv(StringIO(data), header=None, names=['a', 'b'],
432-
dtype={'a': 'bool'})
429+
msg = "Bool column has NA values in column 0"
430+
with pytest.raises(ValueError, match=msg):
431+
parser.read_csv(StringIO(data), header=None, names=['a', 'b'],
432+
dtype={'a': 'bool'})

0 commit comments

Comments
 (0)