chore: switch disallow_forward_slash_in_h5ad default to True#2436
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2436 +/- ##
==========================================
+ Coverage 85.69% 85.70% +0.01%
==========================================
Files 49 49
Lines 7793 7807 +14
==========================================
+ Hits 6678 6691 +13
- Misses 1115 1116 +1
|
disallow_forward_slash_in_h5ad default to True
ilan-gold
reviewed
May 15, 2026
ilan-gold
left a comment
Contributor
There was a problem hiding this comment.
Rerequest once we have the prevention of writing mappings with forward slashes!
ilan-gold
reviewed
May 15, 2026
ilan-gold
approved these changes
May 15, 2026
Contributor
There was a problem hiding this comment.
After a bit of tinkering with _check_has_no_slash_key (#2436 (comment)) I have nothing cleaner. I think it's clear enough - maybe just a bit of pre-lunch confusion / hysteria.
Nice!
Member
Author
I hope that dinners treat you better 😉 |
This was
linked to
issues
May 18, 2026
This was referenced May 18, 2026
katosh
added a commit
to settylab/anndata
that referenced
this pull request
Jul 9, 2026
…keys Upstream switched the `disallow_forward_slash_in_h5ad` default to `True` (scverse#2436), so a `/` in a key now aborts an h5ad write rather than emitting a deprecation warning. `validate_key()` still hardcoded the old severity, which made the repr advertise a slash key as merely deprecated while the corresponding write raised `ValueError`. Grade the key against the live setting instead of a constant, so the badge the repr shows matches what a write would actually do, and keep the softer "(deprecated)" wording for users who opt back out. The branch carried a canary test asserting the old behaviour; replace it with coverage of both settings states.
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.
OK, so this is broken:
anndata/src/anndata/_io/specs/registry.py
Line 369 in 9ebc55b
This fix changes the API in the following way:
k="raw/var"is no longer legal. A quirk of the broken check allowed that before, but it should never have worked.k=""to write into the root is no longer legal, that should be"/"the first one is definitely wanted, the second one used to work, but isn’t documented? Should I bring that back?
TODO:
store_type == "zarr"checks. I’m planning to bring them back.k=""ork="."disallow_forward_slash_in_h5ad=Falseand writing{obs,var}mresults in unreadable anndata files. How should we deal with it? Disallow writing these even when it’sFalse?h5nodes when writing #2099