Kerchunk uses v2-style chunk key "0" for scalar variables. get_chunk_grid_shape interprets this as 1D shape (1,) instead of scalar (), because only "c" is recognized as scalar.
This causes ManifestStore.get_entry to return an ndarray instead of a string when resolving scalar chunk paths, which crashes urlparse downstream.
Reproducer
from virtualizarr.manifests.manifest import ChunkManifest
manifest = ChunkManifest(
entries={"0": {"path": "s3://bucket/file.nc", "offset": 100, "length": 4}},
shape=(),
)
Raises IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
In practice this manifests when using open_virtual_dataset with loadable_variables on a file containing scalar coordinate variables (e.g. time, step).
Kerchunk uses v2-style chunk key
"0"for scalar variables.get_chunk_grid_shapeinterprets this as 1D shape(1,)instead of scalar(), because only"c"is recognized as scalar.This causes
ManifestStore.get_entryto return an ndarray instead of a string when resolving scalar chunk paths, which crashesurlparsedownstream.Reproducer
Raises
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexedIn practice this manifests when using
open_virtual_datasetwithloadable_variableson a file containing scalar coordinate variables (e.g.time,step).