solidsnack / tsv

A simple, line-oriented tabular data format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't let errors pass silently

sirex opened this issue · comments

When row has different number of fields than described in namedtuple, this row is silently converted to None.

Not sure if this is a good thing to let errors pass it silently. I like Python Pandas approach to this:

error_bad_lines : boolean, default True

Lines with too many fields (e.g. a csv line with too many commas) will by default cause an exception to be raised, and no DataFrame will be returned. If False, then these “bad lines” will dropped from the DataFrame that is returned. (Only valid with C parser)

http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html

This seems like a good thing to do.

Fixed here: #6