-
Notifications
You must be signed in to change notification settings - Fork 214
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
Strict record handling #53
Conversation
Thanks for the pull request! Can you please add some tests |
Conflicts: lib/parser_stream.js test/fast-csv.test.js
… cases where there are too few columns provided
Added testcase to describe the intended behavior and updated to the latest HEAD |
… cases where there are too few columns provided
Conflicts: test/parsing.test.js
assert.deepEqual(actual, expected25_invalid); | ||
reachedInvalid = true; | ||
}) | ||
.on("error", function(e){console.log(e)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should error on here you can just do on("error", next)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with e859b69
Thanks
Other than my one comment this looks good Ill merge once fixed. Thanks again |
Hi!
I have the requirement to fail if the records are incomplete. Up to now, fast-csv is quite polite and just consideres an incomplete line as the first field/property and continues.
A workaround wouuld be to check in the validate function if the row is incomplete. but based on the amount of fields, it is very complex to identify a record which may have some fields left empty (which might be valid) and some literally missing.
Therefore introduced a new property (on default, the existing behavior remains unchanged) to emit data-invalid events on incomplete rows.