Classification JSON export: as_json recomputes per-lab evidence keys, permissions and settings for every row
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
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend, performance
Research direction
Start in ClassificationModification.as_json, then trace populate_classification_json and the named evidence key, permission, and per-row lookup paths. Profile an export before changing anything, focusing on work repeated for the same lab, user, or batch. Measure it again afterward; done means those repeated computations and lookups are reused while the exported JSON remains correct.
Written by the indexing model from the issue text.
Description
🤖 Written by Claude
The classification grouping JSON export spends about 39 ms per row in ClassificationModification.as_json. That is about 50 minutes for 75k groupings on a test deployment. Database time is only about 6% of that: the rest is recomputing things that are the same for many rows.
Profile of 500 rows (19.7 s):
- About 50%: the evidence key map.
populate_classification_json→Classification.get_visible_evidence→Classification.evidence_keys→EvidenceKeyMap.with_overridesbuilds and deep-copies the whole evidence key map with the lab's overrides for every row, though an export covers only a handful of labs. - About 13%:
can_write. It runs two guardian permission queries for every row. - 13 queries per row in total. The repeats per row are lab and organisation classification settings (the same few labs), resolved variant info, grouping entry, overlap contribution, condition text match and the user's groups.
Why not store the JSON: the published evidence is already stored (published_evidence). The rest of the output depends on the viewing user (hidden evidence by share level, can_write, messages) and on data that changes after publishing (allele matching and resolved HGVS, condition resolution, withdrawn status, flags, lab names, evidence key definitions). A stored copy would need clearing on every one of those changes.
Fix: compute each of these once per lab, user or batch for an export, and load the per-row lookups once per batch. Measure before and after.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SACGF/variantgrid
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
SACGF/variantgrid#2964 · 1 comment ·
Maintainers usually reply within 1 day
-
Genome build now duplicated in "imported as" on allele pagePossibly taken @TheMadBug claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
SACGF/variantgrid#2950 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
SACGF/variantgrid#2865 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SACGF/variantgrid#2647 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
SACGF/variantgrid#2341 · 3 comments ·
Maintainers usually reply within 1 day
All issues in SACGF/variantgrid
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day