Repository navigation
fix: make_index_unique with a categorical index - #2686
Open
raashish1601 wants to merge 4 commits into
Open
raashish1601 wants to merge 4 commits into
raashish1601 wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2686 +/- ##
==========================================
- Coverage 87.65% 85.83% -1.83%
==========================================
Files 49 49
Lines 8167 8169 +2
==========================================
- Hits 7159 7012 -147
- Misses 1008 1157 +149
|
Author
|
The test jobs pass. The |
ilan-gold
reviewed
Oct 17, 2026
ilan-gold
left a comment
Contributor
There was a problem hiding this comment.
Hi!
- Can you please migrate to our new PR template and fill it out correctly so the CI passes?
- Can you post a reproducer, which the original issue does not have?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make_index_unique(and sovar_names_make_unique/obs_names_make_unique) fails when the index is aCategoricalIndexwith duplicates, because the new names are written into aCategoricalthat does not have them as categories:Still reproduces with anndata 0.12.19. The index is now cast to the dtype of its categories first, so it gets the same treatment as a plain string index (
['a', 'b', 'a-1', 'c', 'b-1'], name kept). A categorical index with no duplicates is still returned unchanged.Added
test_make_index_unique_categoricaltotests/test_utils.py; it fails without the change.tests/test_utils.pypasses locally, and ruff check / format are clean. Release note added indocs/release-notes/2686.fix.md.