Skip to content

BUG: read_csv raising ParserError when some chunks have less columns than header #44644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 28, 2021

Conversation

phofl
Copy link
Member

@phofl phofl commented Nov 27, 2021

@phofl phofl added IO CSV read_csv, to_csv Bug labels Nov 27, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also merge master as the CI didn't run

@jreback jreback added this to the 1.4 milestone Nov 28, 2021
raise ParserError(f"Too many columns specified: expected "
f"{self.table_width - self.leading_cols} "
f"and found {num_cols}")
usecols_not_callable_and_exists = not callable(self.usecols) and self.usecols
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes much more readable here

@jreback jreback merged commit 2d3f3df into pandas-dev:master Nov 28, 2021
@phofl phofl deleted the 21211 branch November 28, 2021 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

read_csv with usecols and chunksize fails if first row of chunk has fewer columns
2 participants