spatialdata icon indicating copy to clipboard operation
spatialdata copied to clipboard

UserWarning: ignoring keyword argument 'read_only' when reading zarr created by older version

Open pakiessling opened this issue 1 year ago • 3 comments

Getting a couple hundred warning of: /python3.10/site-packages/zarr/creation.py:614: UserWarning: ignoring keyword argument 'read_only' compressor, fill_value = _kwargs_compat(compressor, fill_value, kwargs)

When trying to load a previously saved .zarr in a new enviroment. Not sure what version difference causes this. Does not seem to be zarr or spatialdata version. New enviroment versions:

Spatialdata 0.2.3
zarr 2.18.3

Have you seen this before?

pakiessling avatar Sep 30 '24 21:09 pakiessling

Hi thanks for reporting, I haven't noticed this warning before but if I do I'll try to make a fix. If you find a fix meanwhile, a PR would be very welcome 😊

LucaMarconato avatar Oct 01 '24 11:10 LucaMarconato

I've also been noticing this recently with zarr 2.18.3. After some debugging, it looks like it's over in Dask's end. The warning occurs here in dask.array.core.from_zarr.

 z = zarr.open_array(store=url, read_only=True, path=component, **kwargs)

It looks like read_only is not a parameter in Zarr anymore. On Dask's end, they might need to instead pass mode="r".

In SpatialData / ome-zarr, this can show up in many locations, I managed to track it down in _read_multiscales when converting image_reader to a list and when loading the array.

I tried to see if I could fix it on my end by catching and ignoring the warning for this specific case, but it didn't end up working 🤔 .

srivarra avatar Nov 07 '24 02:11 srivarra

Thank you for the details. I couldn't reproduce it, but if I manage to, your analysis will help address this issue. Meanwhile, if anybody can reproduce it, it would be great if you could open a PR. Thanks!

LucaMarconato avatar Jan 05 '25 15:01 LucaMarconato