Skip to content

fix: handle aggregate group-label collisions - #4527

Closed
pandorTanmay-crypto wants to merge 2 commits into
scverse:mainfrom
pandorTanmay-crypto:fix/aggregate-group-label-collision
Closed

pandorTanmay-crypto wants to merge 2 commits into
scverse:mainfrom
pandorTanmay-crypto:fix/aggregate-group-label-collision

Conversation

@pandorTanmay-crypto

@pandorTanmay-crypto pandorTanmay-crypto commented Nov 16, 2026 •

Copy link
Copy Markdown

sc.get.aggregate joined multi-column group labels with underscores, causing distinct groups such as ("a_b", "c") and ("a", "b_c") to collide and raise ValueError. This disambiguates only colliding labels while preserving existing labels otherwise. A release-note fragment is included. Human review remains pending.

Validation:

  • uv run --no-sync pytest -q tests/test_aggregated.py — passed (260 passed, 215 skipped)
  • ruff check --ignore RUF100,PD901 src/scanpy/get/_aggregated.py tests/test_aggregated.py — passed
  • ruff format --check src/scanpy/get/_aggregated.py — passed
  • uv build — passed

Disambiguate underscore-joined labels for distinct multi-column groups. Closes scverse#4526.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pandorTanmay-crypto pandorTanmay-crypto changed the title get: handle aggregate group-label collisions fix: handle aggregate group-label collisions Nov 16, 2026
Use the PR number expected by the release-note CI check. Related to scverse#4527.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pandorTanmay-crypto

Copy link
Copy Markdown
Author

The PR title and release-note filename are now corrected. The remaining validation failure requires either the no milestone label or a milestone; GitHub denies my account permission to apply labels in scverse/scanpy. Could a maintainer add the no milestone label to unblock this check?

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.11%. Comparing base (3962176) to head (fb1905b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/scanpy/get/_aggregated.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4527   +/-   ##
=======================================
  Coverage   85.11%   85.11%           
=======================================
  Files         140      140           
  Lines       12523    12530    +7     
=======================================
+ Hits        10659    10665    +6     
- Misses       1864     1865    +1     
Flag Coverage Δ
hatch-test.low-vers 80.35% <85.71%> (+<0.01%) ⬆️
hatch-test.pre 84.90% <85.71%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/scanpy/get/_aggregated.py 96.86% <85.71%> (-0.32%) ⬇️

@ilan-gold

Copy link
Copy Markdown
Contributor
Screenshot 2026-11-16 at 4 46 11 PM

Closing this PR as it is a violation of our AI policy: https://scverse.org/about/ai_policy/
If you disagree with this opinion, please update.

@ilan-gold ilan-gold closed this Nov 16, 2026
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.

sc.get.aggregate fails when combined group labels collide

2 participants