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

Port merge-user-metadata to augur curate #1495

Merged
merged 7 commits into from
Jun 28, 2024

Conversation

joverlee521
Copy link
Contributor

@joverlee521 joverlee521 commented Jun 28, 2024

Description of proposed changes

Porting over merge-user-metadata from nextstrain/ingest to augur curate apply-record-annotations.

Includes a functional change to skip annotations for fields that do not exist in the record because it's hard to ensure that the new field gets added across all records that are streamed through the command.

This is a deviation from the original nextstrain/ingest script, but I think a necessary one to avoid bugs in the final output metadata.

Related issue(s)

Resolves #1482

Checklist

  • Checks pass
  • If making user-facing changes, add a message in CHANGES.md summarizing the changes in this PR

Noticed while I was removing executable permission for new script that
this file still had executable permissions.
Copy the `merge-user-metadata` script from nextstrain/ingest in
preparation for porting the functionality into the new
`augur curate apply-record-annotations` command.

Copied from <https://github.com/nextstrain/ingest/blob/c94d78d1f38b99e893007a76526f3d3824ecded0/merge-user-metadata>
Includes changes to make the copied script work as a new Augur
subcommand and fit in with the codebase:

- remove unneeded executable permissions and shebang
- add as a subcommand of augur curate
- replace main entrypoint with register_parser() and run()
- let augur curate handle records I/O
- use AugurError and print_err()
The `annotating-new-fields` test reveals undesired behavior which will
be addressed in the next commit.
I don't think we should support adding new fields with record
annotations because it's hard to ensure that the new field gets added
across all records that are streamed through the command.

This is a deviation from the original nextstrain/ingest script, but I
think a necessary one to avoid bugs in the final output metadata.
@joverlee521 joverlee521 requested a review from a team June 28, 2024 00:43
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.28%. Comparing base (0adfe3d) to head (8ee9d82).

Current head 8ee9d82 differs from pull request most recent head 63744c6

Please upload reports for the commit 63744c6 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1495      +/-   ##
==========================================
+ Coverage   69.15%   69.28%   +0.13%     
==========================================
  Files          70       71       +1     
  Lines        7694     7727      +33     
  Branches     1887     1895       +8     
==========================================
+ Hits         5321     5354      +33     
  Misses       2087     2087              
  Partials      286      286              

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

@joverlee521 joverlee521 merged commit 2b51ab4 into master Jun 28, 2024
1 check passed
@joverlee521 joverlee521 deleted the curate-apply-record-annotations branch June 28, 2024 18:23
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.

augur curate apply-record-annotations
2 participants