-
Notifications
You must be signed in to change notification settings - Fork 2
Support CSVs with blank lines and empty values #169
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
Conversation
dmendelowitz
left a comment
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.
This looks great! Just had one small comment
|
|
||
| const INVALID_MRN = 'INVALID MRN'; | ||
| const csvFileModule = new CSVFileModule(path.join(__dirname, './fixtures/example-csv.csv')); | ||
| const csvFileModuleWithBOMs = new CSVFileModule(path.join(__dirname, './fixtures/example-csv-bom.csv')); |
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.
I think we can delete example-csv-bom.csv now, right? It's not used anywhere else.
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 are still using it, just encapsulated it within the test that uses it instead of leaving it up at the top
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.
Sorry if I'm missing something obvious but I don't see the file used anywhere in the tests. The BOM test uses example-csv-empty-values.csv, is that intentional? I think that file has a BOM so it is an accurate test
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.
Definitely not intentional. Definitely a typo. Fixing now.
|
I'm not officially reviewing this PR, but when I was looking through the code yesterday and when Dylan M mentioned the bom nightmares, I remembered there are two other places we probably need these option as well. There's the |
I wonder if it would be worth it to write a wrapper function that just calls |
Ah that's a good point. I feel like that could definitely be worthwhile. |
Summary
Supports ingestion of CSV's with either totally blank rows of data or rows with nothing by empty-values; in both cases those rows will be ignored.
New behavior
Now the CSVFileModule can ingest files with rows that meet the above criteria.
Code changes
Some new tests
Testing guidance
Make sure the tool still works.