augur icon indicating copy to clipboard operation
augur copied to clipboard

Fix curate internal quotes take 2

Open joverlee521 opened this issue 1 year ago • 5 comments

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

  • [ ] Automated checks pass
  • [ ] Check if you need to add a changelog message
  • [ ] Check if you need to add tests
  • [ ] Check if you need to update docs

joverlee521 avatar Aug 01 '24 23:08 joverlee521

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.

codecov[bot] avatar Aug 02 '24 00:08 codecov[bot]

Let's discuss this topic more first. I'll open an issue for it.

tsibley avatar Aug 02 '24 21:08 tsibley

https://github.com/nextstrain/augur/issues/1566

tsibley avatar Aug 02 '24 21:08 tsibley

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
  "	"

tsibley avatar Sep 06 '24 19:09 tsibley

I think this PR should be ready for review based on https://github.com/nextstrain/augur/issues/1566#issuecomment-2356678703.

joverlee521 avatar Oct 02 '24 22:10 joverlee521

Reminder that this is approved and apparently just waiting for changelog and merge :)

corneliusroemer avatar Nov 12 '24 13:11 corneliusroemer

Thanks for the ping @corneliusroemer! I've rebased onto master and added a Changelog entry. I'll merge once all the tests pass again.

joverlee521 avatar Nov 12 '24 23:11 joverlee521