Skip to content
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

Invalid none key #1113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Invalid none key #1113

wants to merge 3 commits into from

Conversation

joverlee521
Copy link
Contributor

Description of proposed changes

  • Updates the export v2 schema to make "none" an invalid key for colorings and branch labels.
  • Updates export v2 to warn about invalid "none" key and ignore it in exports.
  • Does not include changes in export v2 for branch labels to ignore the "none" key because it is currently hard-coded to only export "clades" and "aa" as branch labels. We should ignore "none" keys for branch labels once we allow for arbitrary labels in Allow users to specify arbitrary branch & clade labels #728.

Related issue(s)

Related to nextstrain/auspice#1618

Testing

  • Added new functional test for export v2 using a "none" coloring key.

Checklist

  • Add a message in CHANGES.md summarizing the changes in this PR that are end user focused. Keep headers and formatting consistent with the rest of the file.

@joverlee521 joverlee521 requested a review from a team December 13, 2022 22:16
@codecov
Copy link

codecov bot commented Dec 13, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.94%. Comparing base (53a14a1) to head (fd2cff9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1113      +/-   ##
==========================================
+ Coverage   72.90%   72.94%   +0.04%     
==========================================
  Files          79       79              
  Lines        8299     8306       +7     
  Branches     1694     1696       +2     
==========================================
+ Hits         6050     6059       +9     
+ Misses       1961     1960       -1     
+ Partials      288      287       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

augur/data/schema-export-v2.json Outdated Show resolved Hide resolved
@tsibley
Copy link
Member

tsibley commented Jan 28, 2023

Looks good, needs a changelog entry though.

@genehack
Copy link
Contributor

@joverlee521 how would you feel about rebasing this and adding a Changelog entry so it can get merged? Still seems like a worthwhile change, yeah?

@joverlee521
Copy link
Contributor Author

Rebased and added changelog entry. I've also made additional changes to make "none" an invalid --metadata-columns value since they are added directly as node_attrs that can clash with Auspice's use of "none" to hide tip labels.

This is ready for a fresh review after ~2 years 😅

CHANGES.md Outdated
Comment on lines 8 to 9
* export v2: The string "none" is now an invalid value for `--color-by-metadata` and `--metadata-columns` options to prevent clashes with Auspice's internal use of "none". [#1113][] (@joverlee521)
* schema: The string "none" is now an invalid branch label, node_attr key, and coloring key. [#1113][] (@joverlee521)
Copy link
Member

Choose a reason for hiding this comment

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

Are these technically breaking Makes a backwards incompatible change and should wait for major release changes to be put in the "Major Changes" section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes! Thanks for catching that. Will rebase and update changelog after latest release is complete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in fd2cff9

Make "none" an invalid key for "tree.branch_attrs.labels",
"tree.node_attrs", and "colorings" because the "none" key is used
internally in Auspice to hide branch labels¹ and tip labels².

¹ https://github.com/nextstrain/auspice/blob/a4487b59989270b860d2508636f09ebdbc50d0f8/src/util/treeJsonProcessing.js#L56
² nextstrain/auspice#1618
Update `augur export v2` to warn about the invalid metadata column and
coloring "none" key and skip it in export so that it does not clash with
Auspice's internal use of "none" to hide tip labels.¹

¹ <nextstrain/auspice#1618>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants