Repository navigation
build(zarr-metadata): type-check the tests - #4421
Merged
d-v-b merged 2 commits intoSep 26, 2026
Merged
Conversation
This was referenced Sep 26, 2026
d-v-b
force-pushed
the
build/zarr-metadata-typecheck-tests
branch
from
September 26, 2026 15:06
e0db629 to
71b8d11
Compare
Documentation build overview
|
This was referenced Sep 26, 2026
`to_key_value` keys its result by the store-key literals, and a mapping's key type is invariant, so passing that result to `from_key_value`, which took `Mapping[str, bytes]`, did not type-check. `from_key_value` now takes a mapping keyed by `str` or by any narrower key type. Assisted-by: ClaudeCode:claude-opus-5-5
… version range Pyright checks `tests` as well as `src`, relaxed only for the inferred types of JSON literals, and `# type: ignore` is switched off: a suppression names its rule. The tests' own type errors are fixed without casts. `just check` runs the suite on the oldest and newest interpreters the package declares, and pyright is pinned at 1.1.414. Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b
force-pushed
the
build/zarr-metadata-typecheck-tests
branch
from
September 26, 2026 18:02
71b8d11 to
e009bc3
Compare
d-v-b
marked this pull request as ready for review
September 26, 2026 18:32
This was referenced Sep 26, 2026
This was referenced Sep 27, 2026
Closed
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.
🤖 AI text below 🤖
Pyright now checks
testsas well assrc. Test bodies are held to less inference strictness than the sources, since they are full of untyped JSON literals, but a dangling import, a call that no longer type-checks, or an argument of the wrong type is an error.# type: ignoreis switched off, so a suppression is# pyright: ignore[rule]: it names its rule, and it fails once it stops suppressing anything. The tests' own type errors are fixed without casts.Checking the tests found one real bug, fixed in the first commit with its changelog entry.
to_key_valuekeys its result by the store-key literals, as the changelog documents, and a mapping's key type is invariant, soZarrV3ArrayMetadata.from_key_value(model.to_key_value())did not type-check.from_key_valueis now generic in its key type, and still accepts anystr-keyed store.just checknow runs the tests on the oldest and newest interpreters the package declares, both read frompyproject.toml. The pyright pin moves from 1.1.404 to 1.1.414: the old pin avoided a regression in how pyright types PEP 661 sentinels (microsoft/pyright#11115), which 1.1.413 fixed.This is one of three independent PRs from one review: #4420 lets attributes hold NaN and the infinities, and #4422 adds runtime checks to
ValidationProblem. Each is based onmainand can merge in any order. #4420 has merged, and this is rebased onto it. #4421 and #4422 still change the same import line inmodel/_validation.py, so whichever merges second needs a one-line rebase.🤖 Generated with Claude Code