Skip to content

[Virtual Datasets] Local Storage ValueError: Filenames containing trailing '/#\d+/' are not supported:  #279

@norlandrhagen

Description

@norlandrhagen

Running into an error when trying to roundtrip a virtual dataset using the Local Storage config. 🤞 this is a StorageConfig setup issue on my part.

ValueError: store error: unsuccessful repository operation: `error when handling virtual reference error fetching virtual reference Generic LocalFileSystem error: Filenames containing trailing '/#\d+/' are not supported: `

MRE:

# mamba create --name mre_icechunk python=3.12 -y && \
# mamba activate mre_icechunk && \
# pip install git+https://github.com/mpiannucci/VirtualiZarr@icechunk && \
# pip install git+https://github.com/pydata/xarray@zarr-v3 && \
# pip install git+https://github.com/mpiannucci/kerchunk@v3 --no-deps && \
# pip install git+https://github.com/mpiannucci/numcodecs@zarr3-codecs-beta-sync --no-deps && \
# pip install xarray pooch netcdf4

import icechunk 
import xarray as xr 
from virtualizarr import open_virtual_dataset
from virtualizarr.writers.icechunk import dataset_to_icechunk

# write netcdf to local
ds = xr.tutorial.open_dataset('air_temperature')
ds.to_netcdf('air.nc', mode='w')

# local config
storage_config = icechunk.StorageConfig.filesystem("icechunk/air")
store = icechunk.IcechunkStore.create(storage_config)

# create virtualizarr dataset
vds = open_virtual_dataset('air.nc', indexes={})

# write vds to store
dataset_to_icechunk(vds, store)

# commit to store
store.commit(message="initial commit air_temp virtual dataset")

# round trip 
# ValueError happens here
ds = xr.open_zarr(store, zarr_version=3, consolidated=False)

Thanks for all the integration work so far @mpiannucci @TomNicholas 🎊

Details
File ~/micromamba/envs/tmp_icechunk/lib/python3.12/site-packages/icechunk/__init__.py:441, in IcechunkStore.get(self, key, prototype, byte_range)
    428 """Retrieve the value associated with a given key.
    429 
    430 Parameters
   (...)
    437 Buffer
    438 """
    440 try:
--> 441     result = await self._store.get(key, byte_range)
    442 except KeyNotFound as _e:
    443     # Zarr python expects None to be returned if the key does not exist
    444     # but an IcechunkStore returns an error if the key does not exist
    445     return None

ValueError: store error: unsuccessful repository operation: `error when handling virtual reference error fetching virtual reference Generic LocalFileSystem error: Filenames containing trailing '/#\d+/' are not supported: `

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions