Fix curate internal quotes take 2
Description of proposed changes
Follow the general pattern of creating CSV-like TSVs as discussed in https://github.com/nextstrain/augur/pull/1563#discussion_r1699260164.
We are expecting the CSV-like double quoting when there are internal quotes. If the field value is already correctly double quoted, then there should not be any additional quotes.
Related issue(s)
Resolves https://github.com/nextstrain/augur/issues/1312
Checklist
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 72.29%. Comparing base (
96f077b) to head (3f94f3e). Report is 146 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #1565 +/- ##
=======================================
Coverage 72.29% 72.29%
=======================================
Files 79 79
Lines 8276 8276
Branches 1691 1691
=======================================
Hits 5983 5983
Misses 2008 2008
Partials 285 285
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Let's discuss this topic more first. I'll open an issue for it.
https://github.com/nextstrain/augur/issues/1566
Saving this here for later…
Quote in field value in CSV input.
$ augur curate passthru --metadata <(echo 'a,b'; echo 'x,"y""z"') --output-metadata -
a b
x "y""z"
Quote in field value in NDJSON input.
$ augur curate passthru --output-metadata - <<<'{"a":"x","b":"y\"z"}'
a b
x "y""z"
Tab in field value in NDJSON input.
$ augur curate passthru --output-metadata - <<<'{"x":"\u0009"}'
x
" "
I think this PR should be ready for review based on https://github.com/nextstrain/augur/issues/1566#issuecomment-2356678703.
Reminder that this is approved and apparently just waiting for changelog and merge :)
Thanks for the ping @corneliusroemer! I've rebased onto master and added a Changelog entry. I'll merge once all the tests pass again.