Skip to content

CSV Module now ignores BOMs#107

Merged
mgramigna merged 2 commits into
developfrom
byte-order-mark-parsing
Apr 16, 2021
Merged

CSV Module now ignores BOMs#107
mgramigna merged 2 commits into
developfrom
byte-order-mark-parsing

Conversation

@julianxcarter

@julianxcarter julianxcarter commented Apr 14, 2021

Copy link
Copy Markdown
Contributor

Summary

This PR enables the CSV Module to read csvs with invisible Byte Order Marks at the beginning of a file.

New behavior

The extractor now runs as expected when csvs containing a client's data include Byte Order Marks at the beginning of the file.

Code changes

  1. The parse function that's run in the CSVModule's contractor now has the bom flag set to true, causing any BOMs at the beginning of the csv to be ignored.
  2. A new example-csv-bom.csv file has been added as a test fixture. It's identical to the preexisting example-csv.csv file, except it include a BOM at the beginning of the file.
  3. A test case verifying that the CSV module ignores BOMs has been added to CSVModule.test.js

Testing guidance

Commit 3dd1055 adds both an example csv with a BOM as well as a unit test that attempts to parse this CSV. The bom flag has not been added in this commit though, so you should see this unit test fail as the CSVModule fails to recognize the mrn column. In commit 0e3d63a, that same unit test should pass as that commit enables the bom flag.

@dmendelowitz dmendelowitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me!

@mgramigna mgramigna merged commit ebbb344 into develop Apr 16, 2021
@mgramigna mgramigna deleted the byte-order-mark-parsing branch April 16, 2021 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants