# v3.3.0 evaluation
Date: 2026-07-16. Range reviewed: `85890b3b` (the v3.2.1 release commit) → `23d96d38` (main), which is the entire 3.3.0 release plus one CI-only commit. 109 commits, ~5,000 lines changed under `src/`.
## Verdict
No data-loss regressions found: delete/overwrite paths (`_prepare_overwrite`, `delete_dir`, empty-shard deletion on fill overwrite) are unchanged or verified equivalent, and metadata bytes written to `zarr.json` / `.zarray` / `.zattrs` / `.zmetadata` are byte-identical to v3.2.1 across the matrix exercised (NaN/Inf fill values and attributes, v2 and v3, consolidated hierarchies). The release fixes several silent-corruption bugs that predate the range. The review found two silently-wrong-data regressions (one reachable on the default pipeline, one on the opt-in fused pipeline), one high-impact runtime breakage (fsspec), and several smaller breaks, detailed below.
## Findings
### F1. Complete-chunk writes alias the caller's array — silent wrong data, default pipeline (REPRODUCED)
`_merge_chunk_array` returns a view `value[out_selection]` for any complete chunk (`src/zarr/core/chunk_utils.py:134`). With no compressor, `BytesCodec._encode_sync` produces a zero-copy buffer (`src/zarr/codecs/bytes.py:155`) and `MemoryStore.set` stores it by reference (`src/zarr/storage/_memory.py:120`). Net effect: after `z[:] = data` on an uncompressed MemoryStore array, mutating `data` mutates the stored chunks.
At v3.2.1 the zero-copy fast path fired only when a single chunk covered the entire write (that case was already aliased — pre-existing); this range widened it to every complete chunk, so ordinary multi-chunk writes are now affected. `tests/test_fastpath_equivalence.py:157` pins the view as intentional but only tests the write-doesn't-mutate-source direction, not source-mutates-store. Reads are unaffected (scatter copies). Suggested fix: copy at the MemoryStore boundary, or narrow the view fast path, or document sharing semantics explicitly.
### F2. FusedCodecPipeline silently drops outer AA/BB codecs around a partial-IO-capable inner codec (REPRODUCED)
`FusedCodecPipeline.supports_partial_decode/encode` pass `require_no_aa_bb=False` (`src/zarr/core/codec_pipeline.py:936-954`), unlike `BatchedCodecPipeline`, and the partial paths (`codec_pipeline.py:1043`, `:1115`, `:1193`) then call the array-bytes codec directly, never running outer codecs. `codecs=[TransposeCodec(order=(1,0)), ShardingCodec(...)]` written by the batched pipeline reads back transposed under fused, and vice versa — silently. `[ShardingCodec, Crc32cCodec]` fails loudly instead (checksum mismatch). The in-code NOTE at `codec_pipeline.py:146-149` calls the divergence intentional, but it is wrong-data, not an IO-strategy difference.
Mitigations: the fused pipeline is opt-in, and `create_array` never produces this layout (it nests filters/compressors inside the shard) — it requires explicit `codecs=` or metadata written by another implementation, which is spec-legal. Fix: pass `require_no_aa_bb=True` like the batched pipeline.
### F3. `FsspecStore.close()` closes the session of a shared, cached filesystem (REPRODUCED)
`from_url` sets `_owns_fs = True` unconditionally (`src/zarr/storage/_fsspec.py:276`), but it calls `fsspec.url_to_fs` without `skip_instance_cache`, so fsspec's instance cache returns the same filesystem object for every call with equal storage options. Closing one store (`_fsspec.py:296-306`, new in #4003) closes the aiohttp/aiobotocore session for every sibling store, for the user's own `fsspec.filesystem(...)` handle, and — because the dead instance stays in fsspec's cache — for every future `from_url` store in the process. Any S3/HTTP user who uses `with store:` or calls `close()` and then keeps working hits `RuntimeError: Session is closed`. Loud, not silent, but a straight regression vs. v3.2.1 where `close()` never touched the fs. `_make_async`-wrapped sync filesystems (e.g. `memory://`) are not affected — the wrapper is a fresh instance each time.
Related wart from the same commit: `with_read_only()` (`_fsspec.py:290-294`) mutates `self._owns_fs = False` on the source store, silently changing what the original store's `close()` does. Fix direction: pass `skip_instance_cache=True` in `from_url`, or never claim ownership of a cache-served instance.
### F4. `ShardingCodec` old→new pickle break (REPRODUCED)
`__setstate__` does `state["subchunk_write_order"]` (`src/zarr/codecs/sharding.py:441`), but a codec pickled by zarr ≤ 3.2.x has `state = to_dict()` only, so unpickling raises `KeyError`. Bites mixed-version dask clusters (client on 3.2.x, worker on 3.3.0). New→old is fine. Fix: `state.get("subchunk_write_order", "morton")`.
### F5. Spec-invalid v3 arrays that used to open now hard-error at open (REPRODUCED)
`BytesCodec.from_dict` now parses a missing `endian` as `None` (#3417, `src/zarr/codecs/bytes.py:65`), and the eager codec evolution at array construction (`src/zarr/core/metadata/v3.py:522`) hits the pre-existing raise at `bytes.py:91-94` for multi-byte dtypes. At v3.2.1 such metadata opened and decoded assuming native byte order — itself a silent-wrong-data hazard on big-endian readers, so the new behavior is arguably correct, but arrays from lenient third-party writers that opened under 3.2.1 no longer open, and the failure moved from decode time to open time. Not mentioned in the 3.3.0 release notes; deserves an entry.
### F6. Enum→string deprecations break more than the release notes say (REPRODUCED)
`BytesCodec.endian`, `BloscCodec.shuffle`/`cname`, `ShardingCodec.index_location`, and `NDBuffer.byteorder` (`src/zarr/core/buffer/core.py:499`) are now plain strings. `.value`/`.name` access raises `AttributeError` immediately, with no deprecation warning. The shim classes (`src/zarr/codecs/_deprecated_enum.py`) are not callable and not iterable, so `Endian("little")`, `BloscShuffle["shuffle"]`, and `list(Endian)` all raise `TypeError` — and pickles from older zarr versions containing real enum members fail to unpickle (Enum pickles by `(class, (value,))` call). `==` comparisons against shim members still work (member access returns the string with a `DeprecationWarning`). The property change is changelogged; the `.value` and unpickling breaks are not.
### F7. Partial-shard read errors now surface as `BaseExceptionGroup` (REPRODUCED)
v3.2.1 awaited each inner chunk's `get()` directly, so store errors (`PermissionError`, timeouts) propagated as themselves. The `Store.get_ranges` path wraps fetch failures in a PEP 654 `BaseExceptionGroup`; the sharding codec strips `FileNotFoundError` and re-raises the remainder as a group (`src/zarr/codecs/sharding.py:1605`, `:1677`), so `except PermissionError:` around sharded reads no longer catches. This hits the default pipeline, error cases only. Relatedly, a shard deleted between index fetch and data fetch now yields fill values for the whole selection instead of propagating — intentional and tested, but a semantics choice.
### F8. A v2 `.zattrs` containing JSON `null` no longer opens (REPRODUCED)
`buffer_to_json_object` (`src/zarr/core/_json.py:44-63`, from #3998) raises `TypeError: Expected a JSON object, got NoneType.` where v3.2.1 flowed the `None` into `parse_attributes` and got `{}`. Narrow: zarr-python never wrote a null `.zattrs`, and non-object `.zattrs` (e.g. a JSON list) raised in both versions. One-line guard at the `.zattrs` call sites (`src/zarr/core/array.py:315`, `src/zarr/core/group.py:623`, `:3385`) if worth fixing.
### Latent and lower-confidence risks (no MVCE)
- Fused bulk whole-shard decode ignores the `Struct` byte-order special case from #4142: `src/zarr/codecs/sharding.py:1166-1170` builds the read-view dtype only for `HasEndianness` dtypes, while `BytesCodec._decode_sync` (`src/zarr/codecs/bytes.py:110-114`) additionally handles `Struct`. Currently unreachable — sharded `Struct` arrays crash on a pre-existing bug (the instance `lru_cache` on `_get_chunks_per_shard` can't hash an `ArraySpec` with a void fill value, present at v3.2.1) — but if that is ever fixed without fixing the bulk path, big-endian `Struct` shards bulk-decode to silently byteswapped values.
- Fused pipeline blocks the event loop: `async read`/`write` call `read_sync`/`write_sync` inline (`codec_pipeline.py:1185`, `:1238`), doing store IO plus codec compute on the loop thread. Concurrent sync operations from multiple user threads serialize end-to-end; async applications awaiting `AsyncArray` methods stall other coroutines. By design per the docstring, but a real behavioral difference vs. batched.
- Swallowed write errors: in `_encode_and_write_as_completed` (`codec_pipeline.py:266-270`), if a later encode raises, already-launched write tasks are never awaited, so a concurrently failing store write's exception is dropped and the operation is partially applied.
- Third-party async-only partial-decode codecs break under fused: the gates are `isinstance(..., ArrayBytesCodecPartialDecodeMixin)` but dispatch asserts `hasattr(codec, "_decode_partial_sync")` (`codec_pipeline.py:1045`, `:1117`); the mixins define no sync variants.
- Spec-threading divergence for bytes-bytes codecs between pipelines (`chunk_utils.py:310-313` vs. `codec_pipeline.py:603-611`): identity for all in-tree codecs, but a third-party array-bytes codec with a non-identity `resolve_metadata` would see divergent specs.
- Metadata `__eq__`/`__hash__` now serialize the full document (`to_dict()` / `json.dumps(..., sort_keys=True)`, `src/zarr/core/metadata/v2.py:239-250`, `v3.py:694-705`). Semantically intended (NaN fill values now compare equal), but measurably slower if equality lands in a hot path, and equality is now semantic rather than field-wise.
- `get_ranges` test coverage gaps: no tests for overlapping/duplicate ranges, ranges beyond EOF, coalesced-vs-uncoalesced equivalence on the same data, `get_ranges` through `CacheStore`/`LoggingStore`, or early close of the async iterator. Also `CacheStore`-wrapped partial-shard reads bypass the cache entirely via the `WrapperStore` forward (correct data, just uncached).
- Removed internals that existed in released v3.2.1 (underscore/`zarr.core`-private, but downstream code sometimes reaches in): `Store._get_bytes`/`_get_json` and sync variants, `zarr.core.metadata.v3.resolve_chunks` (now `create_chunk_grid_metadata`, changed signature), `zarr.codecs.bytes.default_system_endian`, `normalize_chunks`, `UTF8Base`, `_NUMPY_SUPPORTS_VLEN_STRING`, `DefaultFillValue` (replaced by a `Sentinel` — `isinstance(x, DefaultFillValue)` code breaks), and `zarr.core.dtype.DTypeJSON` is no longer importable at runtime (moved under `TYPE_CHECKING`).
## Verified non-regressions worth recording
- Coalesced-read byte math traced end to end (`src/zarr/core/_coalesce.py`: sort-by-start, running span, `end = max(r.end)` for nested ranges, `big[r.start-start : r.end-start]` slicing with original indices preserved) and confirmed empirically with gap=0 and gap=1 MiB on compressed variable-length chunks. Positional mapping back in the sharding consumer (`sharding.py:1591-1601`) is correct.
- Shard index byte-range math for both index locations, read-modify-write partial writes, empty-shard deletion on fill overwrite, scalar-broadcast fast path, 0-dim sharded arrays, and the bulk-decode gather-indexer gates (reversed vindex, oindex integer arrays, masks, duplicate coords all fall through correctly) — differential-tested across both pipelines.
- The `getsize_prefix` normalization fix (`src/zarr/abc/store.py:608`) is a deliberate behavior change (no longer counts siblings sharing a string prefix, or a key exactly equal to the prefix); `Array.nbytes_stored`/`Group` usage unaffected.
- The 5-fix storage commit (#4074) all check out as genuine fixes, including the `SuffixByteRequest` clamp that previously returned silently wrong short slices from MemoryStore.
- The structured-dtype byte-order fix (#4142) and F-order vlen fix (#4116) both address pre-existing corruption bugs, not bugs introduced in this range; the vlen fix is complete for v3 (covers both native vlen codecs and all numcodecs wrappers; decode side already reshaped in C order; v2 path was already symmetric). One forward-compat note: struct data written with an explicit `endian: "big"` bytes codec is silently misread by pre-fix zarr-python — but the old reader misread its own big-endian struct writes too, and default little-endian struct data is byte-identical across versions.
- `_prepare_overwrite` (from the internal-simplifications commit) exactly matches the three inline blocks it replaced — no widening of what `overwrite=True` deletes.
- Rejections added by chunk normalization (`chunks=True`, under-specified tuples, per-dim `None`) are intentional and changelogged; `chunks=(5, -1)` failed at base and now works.
- The eager `ArraySpec` cache for regular grids (`src/zarr/core/array.py:5463`, `:5641`) is equivalent for edge chunks, since `codec_shape` equals the nominal chunk shape for regular grids.
## Most impactful changes for users
Positive:
- Partial shard reads are dramatically faster (#3004/#3987): coalesced, concurrent `get_ranges` instead of serial per-chunk `get`, tunable via `array.sharding_coalesce_max_gap_bytes` (1 MiB) and `array.sharding_coalesce_max_bytes` (16 MiB), per-array via `create_array(config=...)`. Caveat: concurrency multiplies (`max_concurrency=10` per shard × array-level `async.concurrency` 10) — up to ~100 in-flight store requests where reads were serial per shard before; watch object-store rate limits.
- Opt-in `FusedCodecPipeline` (#3885): up to ~24×/14× write/read speedups on many-chunks-per-shard layouts. Given F2 and the latent items above, treat as genuinely experimental.
- New `Store.get_ranges` / `get_ranges_sync` API; `subchunk_write_order` on `ShardingCodec` (write-time only, not persisted in metadata); hashable metadata objects; `-1` accepted in chunk tuples; scalar (0-d) `save_array`/`load`; writes to 0-d sharded arrays.
- Real corruption fixes: structured-dtype byte order in the bytes codec, F-contiguous arrays through vlen/numcodecs filters, oversized `SuffixByteRequest` on MemoryStore, `getsize_prefix` over-counting, user attribute dicts no longer mutated.
Negative: F1–F8 above. Suggested priority: fix F3 (fsspec close), F4 (one-line pickle guard), and F2 (one flag) first — all small; then decide F1 (copy at the store boundary vs. document sharing semantics); add release notes for F5, F6's `.value` break, and F7.
## MVCEs
Each script is self-contained (PEP 723 inline metadata, zarr pinned to `23d96d38`). Save anywhere and run with `uv run <name>.py`. All eight were run and reproduced on 2026-07-16. Copies live in `dev-docs/mvces/` if extracted; the canonical versions are inline below.
### F1 — `mvce_memorystore_aliasing.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# "numpy",
# ]
# ///
"""Complete-chunk writes alias the caller's array (default pipeline).
`_merge_chunk_array` returns a view of the user's array for any complete
chunk; with no compressor, BytesCodec encodes zero-copy and MemoryStore
stores the buffer by reference. Mutating the source array after the write
silently mutates the stored data.
At v3.2.1 only the single-chunk-covers-the-whole-write case aliased; now
every complete chunk does.
"""
import numpy as np
import zarr
from zarr.storage import MemoryStore
z = zarr.create_array(
store=MemoryStore(), shape=(8,), chunks=(4,), dtype="i4", compressors=None
)
data = np.arange(8, dtype="i4")
z[:] = data # two complete chunks, neither covers the whole write
assert (z[:] == data).all()
data[:] = -1 # mutate the source array *after* the write
readback = z[:]
print(f"stored data after mutating source: {readback}")
assert (readback == -1).any(), "did not reproduce: stored data unaffected"
print("REPRODUCED: stored chunk data aliases the caller's array")
```
### F2 — `mvce_fused_outer_transpose.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# "numpy",
# ]
# ///
"""FusedCodecPipeline silently skips outer codecs around a sharding codec.
Fused's supports_partial_decode/encode pass require_no_aa_bb=False, so the
partial-IO paths call the sharding codec directly and never run an outer
TransposeCodec. Data written by the batched pipeline reads back transposed
under the fused pipeline. Needs explicit `codecs=` (create_array never
produces this layout), but the metadata is spec-legal.
"""
import numpy as np
import zarr
from zarr.codecs import ShardingCodec, TransposeCodec
from zarr.storage import MemoryStore
store = MemoryStore()
data = np.arange(16, dtype="i4").reshape(4, 4)
z = zarr.create(
store=store,
shape=(4, 4),
chunks=(4, 4),
dtype="i4",
zarr_format=3,
codecs=[TransposeCodec(order=(1, 0)), ShardingCodec(chunk_shape=(2, 2))],
)
z[:] = data # written with the default BatchedCodecPipeline
assert (zarr.open_array(store=store)[:] == data).all() # batched reads it back fine
with zarr.config.set(
{"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"}
):
fused_readback = zarr.open_array(store=store)[:]
print(f"expected:\n{data}\nfused pipeline read:\n{fused_readback}")
assert (fused_readback == data.T).all(), "did not reproduce"
print("REPRODUCED: fused pipeline silently returns transposed data")
```
### F3 — `mvce_fsspec_close_shared_fs.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# "fsspec",
# "aiohttp",
# ]
# ///
"""FsspecStore.close() closes the session of a shared, cached filesystem.
from_url() sets _owns_fs=True unconditionally, but fsspec's instance cache
returns the same filesystem object for equal storage options. Closing one
store kills the client session for every sibling store, and the dead
filesystem stays in fsspec's cache, poisoning future from_url() calls.
No network access is needed to demonstrate this.
"""
from zarr.core.sync import sync
from zarr.storage import FsspecStore
s1 = FsspecStore.from_url("http://example.com/a")
s2 = FsspecStore.from_url("http://example.com/b")
assert s1.fs is s2.fs, "fsspec instance cache should return the same fs"
s1.close()
session = sync(s2.fs.set_session())
print(f"sibling store's client session closed: {session.closed}")
assert session.closed, "did not reproduce"
s3 = FsspecStore.from_url("http://example.com/c") # brand-new store, same cache
assert s3.fs is s2.fs
print("REPRODUCED: close() killed the shared session; cache still serves the dead fs")
```
### F4 — `mvce_sharding_pickle.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# ]
# ///
"""ShardingCodec pickled by zarr <= 3.2.x fails to unpickle on current main.
Old __getstate__ returned to_dict() only; the new __setstate__ does
state["subchunk_write_order"] and raises KeyError on the old state shape.
Bites mixed-version distributed (dask) clusters.
"""
from zarr.codecs import ShardingCodec
codec = ShardingCodec(chunk_shape=(2, 2))
old_state = codec.to_dict() # exactly what zarr <= 3.2.x __getstate__ produced
restored = ShardingCodec.__new__(ShardingCodec)
try:
restored.__setstate__(old_state)
except KeyError as e:
print(f"REPRODUCED: __setstate__ raised KeyError({e})")
else:
raise AssertionError("did not reproduce: old state unpickled fine")
```
### F5 — `mvce_bytes_endian_open.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# "numpy",
# ]
# ///
"""v3 arrays whose bytes codec omits `endian` no longer open (multi-byte dtype).
BytesCodec.from_dict now parses a missing `endian` as None (#3417), and the
eager evolve at array construction raises. Such metadata is spec-invalid,
but lenient third-party writers produced it and v3.2.1 opened it (assuming
native byte order). Now it is a hard error at open time.
"""
import json
import zarr
from zarr.core.buffer import default_buffer_prototype
from zarr.core.sync import sync
from zarr.storage import MemoryStore
store = MemoryStore()
zarr.create_array(store=store, shape=(4,), chunks=(4,), dtype="uint16")
proto = default_buffer_prototype()
meta = json.loads(sync(store.get("zarr.json", proto)).to_bytes())
meta["codecs"] = [{"name": "bytes"}] # what a lenient writer emits: no endian
sync(store.set("zarr.json", proto.buffer.from_bytes(json.dumps(meta).encode())))
try:
zarr.open_array(store=store)
except ValueError as e:
print(f"REPRODUCED: open_array raised ValueError: {e}")
else:
raise AssertionError("did not reproduce: array opened fine")
```
### F6 — `mvce_enum_to_string.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# ]
# ///
"""Codec enum attributes are now plain strings; .value access breaks without warning.
BytesCodec.endian, BloscCodec.shuffle/cname, ShardingCodec.index_location are
literal strings. `.value` / `.name` raise AttributeError immediately (no
deprecation path), and the shim enum classes are not callable, so unpickling
codec objects from zarr <= 3.2.x that contain real enum members also fails.
"""
from zarr.codecs import BytesCodec
from zarr.codecs.bytes import Endian
codec = BytesCodec(endian="little")
try:
codec.endian.value
except AttributeError as e:
print(f"REPRODUCED: .value raised AttributeError: {e}")
else:
raise AssertionError("did not reproduce: .value worked")
try:
Endian("little") # how Enum members unpickle: Endian.__call__(value)
except TypeError as e:
print(f"REPRODUCED: Endian('little') raised TypeError: {e}")
else:
raise AssertionError("did not reproduce: Endian call worked")
```
### F7 — `mvce_partial_shard_exceptiongroup.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# "numpy",
# ]
# ///
"""Store errors during partial shard reads now surface as BaseExceptionGroup.
v3.2.1 awaited each inner chunk's get() directly, so a PermissionError (or
timeout, etc.) propagated as itself. The Store.get_ranges path wraps failures
in a BaseExceptionGroup and the sharding codec re-raises the non-FileNotFound
remainder as a group, so `except PermissionError:` no longer catches.
"""
import numpy as np
import zarr
from zarr.abc.store import ByteRequest, RangeByteRequest
from zarr.storage import MemoryStore
class DenyRangeReads(MemoryStore):
"""Allows suffix reads (shard index) but denies ranged data reads."""
async def get(self, key, prototype, byte_range: ByteRequest | None = None):
if isinstance(byte_range, RangeByteRequest):
raise PermissionError(f"denied: {key}")
return await super().get(key, prototype, byte_range=byte_range)
def get_sync(self, key, prototype, byte_range: ByteRequest | None = None):
if isinstance(byte_range, RangeByteRequest):
raise PermissionError(f"denied: {key}")
return super().get_sync(key, prototype, byte_range=byte_range)
z = zarr.create_array(
store=DenyRangeReads(), shape=(8, 8), chunks=(2, 2), shards=(8, 8), dtype="i4"
)
z[:] = np.arange(64, dtype="i4").reshape(8, 8) # full-shard write: no ranged reads
try:
z[:2, :2] # partial shard read -> get_ranges -> PermissionError
except PermissionError:
raise AssertionError("bare PermissionError was caught: not reproduced") from None
except BaseExceptionGroup as eg:
inner = eg.exceptions
print(f"REPRODUCED: caught {type(eg).__name__} containing {[type(e).__name__ for e in inner]}")
```
### F8 — `mvce_zattrs_null.py`
```python
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "zarr @ git+https://github.com/zarr-developers/zarr-python@23d96d38ae1cb1b722681f16eec7af171890b367",
# "numpy",
# ]
# ///
"""A v2 .zattrs containing JSON `null` no longer opens.
v3.2.1 treated it as empty attributes ({}); buffer_to_json_object (#3998) now
raises TypeError. Narrow: zarr-python never wrote a null .zattrs, but other
writers may have.
"""
import zarr
from zarr.core.buffer import default_buffer_prototype
from zarr.core.sync import sync
from zarr.storage import MemoryStore
store = MemoryStore()
zarr.create_array(store=store, shape=(4,), chunks=(4,), dtype="i4", zarr_format=2)
proto = default_buffer_prototype()
sync(store.set(".zattrs", proto.buffer.from_bytes(b"null")))
try:
zarr.open_array(store=store, zarr_format=2)
except TypeError as e:
print(f"REPRODUCED: open_array raised TypeError: {e}")
else:
raise AssertionError("did not reproduce: array opened fine")
```