Overlaps grid skew_status subquery returns an arbitrary next step, not the highest
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read classification/views/overlaps_datatables.py and classification/views/overlaps_view.py to trace the five subquery call sites, then find the related overlap tests. Add a case with three next steps inserted from lowest to highest and check that the annotated skew_status is the highest; confirm the grid and download use the shared helper.
Written by the indexing model from the issue text.
Description
🤖 Written by Claude
The overlaps grid (classification/overlaps) and the overlaps CSV download annotate each overlap with skew_status. It's meant to be the highest triage next step among the contributions the lab picker selects. The subquery doesn't compute that.
OverlapContributionNextStep.objects.filter(lab_filter_q).filter(
overlap=OuterRef('pk')
).annotate(max_status=Max('next_step')).values_list('max_status')[:1]
.annotate(Max(...)) with no .values() before it groups by the OverlapContributionNextStep row's own id. Each next step is then its own group, so Max is just that row's next_step, and [:1] with no ordering returns whichever row Postgres reads first. EXPLAIN shows GroupAggregate Group Key: "U0".id.
The same pattern is copied five times:
- four times in
OverlapColumns.get_initial_queryset(classification/views/overlaps_datatables.py); - once in
download_overlaps(classification/views/overlaps_view.py).
Effect
- Sort order: the grid's default sort (Summary column:
overlap_status,skew_status, ...) and the download's ordering use an arbitrary lab's next step instead of the highest. - Tab filtering: "Awaiting Triage" and the other tabs filter next steps by
next_step__inbefore the subquery, then only check that some match exists. Membership is right; only the value used for sorting is wrong. - Not affected:
- the per-row "next step" label shown in the Summary cell, which uses a separate
aggregate(); - overlaps where every contribution has the same next step.
- the per-row "next step" label shown in the Summary cell, which uses a separate
Fix
Order by next_step and take the first:
Subquery(next_steps_qs.order_by('-next_step').values('next_step')[:1])
Put it in one helper for the five call sites. A test can give an overlap three next steps, inserted lowest first, and check the annotation is the highest. Against the current code that test returns the lowest.
Found while benchmarking the overlaps page for SACGF/variantgrid_shariant#394.
- Dominant language
- Python
- Stars
- 31
- Forks
- 4
- Avg merge
- 8h 15m
- Merged PRs (30d)
- 350
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 74/100
SACGF/variantgrid#2675 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SACGF/variantgrid#2672 · 1 comment ·
Maintainers usually reply within 1 day
-
Remove unused DiscordanceLevel count properties from AlleleOverlapsPossibly taken A pull request linked to this issue is open or already merged. OpenRefactoring
Difficulty 1/5 Under an hour Newbie friendliness 90/100
SACGF/variantgrid#2424 ·
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
-
Overlap.all_hgvs fallback always returns "-" when the selected labs aren't in the overlapPossibly taken A pull request linked to this issue is open or already merged. Openbug classification
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
SACGF/variantgrid#2329 · 1 comment ·
Maintainers usually reply within 1 day
All issues in SACGF/variantgrid
Similar issues
-
bug severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
curriculum documentation quality
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
githubnext/gh-aw-workshop#5367 ·
Maintainers usually reply within 3 days
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scopeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Create Noise Latents ignores randomize_seed and produces the same noise every runPossibly taken @griptapeops claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
Maintainers usually reply within 1 day
-
Jenkins capacity report: metrics history is lost when archiving a month failsPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
adoptium/infrastructure#4568 ·
Maintainers usually reply within 1 day