Skip to content

Commit 272be1f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ad1d1da commit 272be1f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pandas/io/parsers/base_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ def _check_data_length(
614614
columns: list of column names
615615
data: list of array-likes containing the data column-wise.
616616
"""
617-
if columns and len(data)!=len(columns):
617+
if columns and len(data) != len(columns):
618618
warnings.warn(
619619
f"Length of header or names ({len(columns)}) does not match number of "
620620
f"fields in line ({len(data)}). Extra field will be dropped.",

pandas/tests/io/parser/test_python_parser_only.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ def test_on_bad_lines_extra_fields_warns(python_parser_only):
333333
def line_fixer(_line):
334334
return ["1", "2", "3", "4", "5"]
335335

336-
expected_warning = (
337-
r"Length of head or names \(3)\ does not match number of fields in line \(5\)\. Extra field will be dropped\."
338-
)
336+
expected_warning = r"Length of head or names \(3)\ does not match number of fields in line \(5\)\. Extra field will be dropped\."
339337

340338
for index_col in [None, 0]:
341339
with pytest.warns(ParserWarning, match=expected_warning):

0 commit comments

Comments
 (0)