BUG: Standardize malformed row handling in Python engine by gfyoung · Pull Request #15913 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation8 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

gfyoung

Wrap next(source) when source is a file-buffer object to allow for more uniform error message displaying in the Python engine. Closes #15910.

jreback

elif 'newline inside string' in msg:
msg = ('EOF inside string starting with '
'line ' + str(kwargs['row_num']))
raise Exception(msg)

Choose a reason for hiding this comment

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

this is a plain Exception? shouldn't it be a ValueError?

Choose a reason for hiding this comment

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

Copied from where it was originally, which according to the blame was refactored by you! 😄

In any case, I agree: we should just remove that line and raise csv.Error now

Choose a reason for hiding this comment

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

hmm don't remember that :)

Choose a reason for hiding this comment

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

yeah csv.Error sounds fine

make a note of this in the whatsnew though

Choose a reason for hiding this comment

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

Yep, done.

@codecov

@gfyoung

@gfyoung

@jreback : Everything is green and ready to go.

@jreback

@gfyoung gfyoung deleted the invalid-quote-skipfooter branch

April 6, 2017 14:53

2 participants

@gfyoung @jreback