Skip to content

Commit 92d2611

Browse files
authored
Add missing space in read_csv usecols out-of-bounds case (pandas-dev#55651)
1 parent 625d8d6 commit 92d2611

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pandas/_libs/parsers.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ cdef class TextReader:
993993
missing_usecols = [col for col in self.usecols if col >= num_cols]
994994
if missing_usecols:
995995
raise ParserError(
996-
"Defining usecols without of bounds indices is not allowed. "
996+
"Defining usecols with out-of-bounds indices is not allowed. "
997997
f"{missing_usecols} are out of bounds.",
998998
)
999999

pandas/io/parsers/python_parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ def _handle_usecols(
615615
]
616616
if missing_usecols:
617617
raise ParserError(
618-
"Defining usecols without of bounds indices is not allowed. "
619-
f"{missing_usecols} are out of bounds.",
618+
"Defining usecols with out-of-bounds indices is not allowed. "
619+
f"{missing_usecols} are out-of-bounds.",
620620
)
621621
col_indices = self.usecols
622622

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def test_usecols_indices_out_of_bounds(all_parsers, names):
467467
a,b
468468
1,2
469469
"""
470-
with pytest.raises(ParserError, match="Defining usecols without of bounds"):
470+
with pytest.raises(ParserError, match="Defining usecols with out-of-bounds"):
471471
parser.read_csv(StringIO(data), usecols=[0, 2], names=names, header=0)
472472

473473

0 commit comments

Comments
 (0)