You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9f0ae4e
Browse filesBrowse the repository at this point in the historyBrowse files
fix: replace runtime assert statements with explicit checks (#4363)
* fix: replace runtime assert statements with explicit checks
Asserts are stripped under `python -O`, so checks that matter for
correctness or type narrowing must be explicit. Two were load-bearing:
`GroupMetadata.from_dict` asserted on node_type and the array-to-group
fallback in `zarr.api.asynchronous.open` caught the AssertionError, and
`make_store` asserted on mode ahead of the real validation.
Redundant asserts are deleted, narrowing asserts are restructured so
mypy narrows on its own, and the rest become explicit raises. Ruff S101
is enabled with `tests/` and `src/zarr/testing/` excluded.
Assisted-by: ClaudeCode:claude-fable-5-1
* docs: add changelog fragment for #4363
Assisted-by: ClaudeCode:claude-fable-5-1
* ci: scope the no-assert lint to runtime code across the monorepo
The S101 per-file ignores only covered the root tests/ and
src/zarr/testing/. The packages under packages/ inherit the root ruff
config, so the rule fired on 1524 asserts in their tests, examples, and
test-support modules and broke the ruff, Lint, pre-commit.ci, and
zarr-http-server jobs. Widen the ignores to **/tests/**, **/examples/**,
and **/testing/**, and exclude zarr-indexing's runtime source for now;
its own asserts are tracked as a separate change.
Assisted-by: ClaudeCode:claude-fable-5-1
0 commit comments