Remove the `pubmed_search_terms` evidence key

Open
#2,570 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
django, python
Domain
api, backend, database

Research direction

Start by tracing SpecialEKeys.PUBMED_SEARCH_TERMS and the autopopulate branch in classification/autopopulate_evidence_keys/evidence_from_variant.py; then read the listed variant annotation files and existing ManualOperation commands. Add the migration and cleanup command, preserving records with values for reporting. Done when the key and listed references are removed and an API patch with "pubmed_search_terms": null stores nothing without a validation message.

Written by the indexing model from the issue text.

Description

🤖 Written by Claude

pubmed_search_terms was added for #5 (2020) and switched off a week later behind ANNOTATION_PUBMED_SEARCH_TERMS_ENABLED = False, which no deployment sets. Nothing has written a value since. The only stored values are blank fields locked by Shariant uploads, {"immutable": "api"}. The Shariant upload's insert_nones sends every key the source deployment has, including this one, as null.

Remove:

  • the EvidenceKey row (data migration), and SpecialEKeys.PUBMED_SEARCH_TERMS;
  • the autopopulate branch in classification/autopopulate_evidence_keys/evidence_from_variant.py and the ANNOTATION_PUBMED_SEARCH_TERMS_ENABLED setting;
  • the variant page link (variantopedia/templates/variantopedia/variant_details/annotation_external_ids.html, and the settings_value line in variant_details.html);
  • VariantAnnotation.get_pubmed_search_terms and get_variant_pubmed_search_terms in annotation/external_search_terms.py.

Add a one_off_remove_pubmed_search_terms command, run as a ManualOperation, that strips the key from Classification.evidence where it has no value or note. It should report any record that has a value instead of deleting it.

Test: an API patch with "pubmed_search_terms": null, sent once the key no longer exists, stores nothing and raises no validation message. Deployments on older code keep sending the key until they upgrade.

Dominant language
Python
Stars
31
Forks
4
Avg merge
4h 52m
Merged PRs (30d)
183

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SACGF/variantgrid

All issues in SACGF/variantgrid

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.