Repository navigation
Closed
Labels
needs triageNeeds a response from a contributorNeeds a response from a contributor
Description
I'm having various issues and errors with da.to_zarr() using:
dask==2025.1.0
zarr==3.0.1
fsspec==2024.12.0
from skimage import data
import dask.array as da
import zarr
dask_data = da.from_array(data.coins(), chunks=(64, 64))
da.to_zarr(dask_data, "test_dask_to_zarr.zarr", compute=True, storage_options={"chunks": (64, 64)})
# Traceback (most recent call last):
# File "/Users/wmoore/Desktop/python-scripts/zarr_scripts/test_dask_to_zarr.py", line 7, in <module>
# da.to_zarr(dask_data, "test_dask_to_zarr.zarr", compute=True, storage_options={"chunks": (64, 64)})
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/dask/array/core.py", line 3891, in to_zarr
# store = zarr.storage.FsspecStore.from_url(
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/zarr/storage/_fsspec.py", line 182, in from_url
# return cls(fs=fs, path=path, read_only=read_only, allowed_exceptions=allowed_exceptions)
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/zarr/storage/_fsspec.py", line 96, in __init__
# raise TypeError("Filesystem needs to support async operations.")
# TypeError: Filesystem needs to support async operations.
Trying to use a local store has a different error:
store = zarr.storage.LocalStore("test_dask_to_zarr.zarr", read_only=False)
da.to_zarr(dask_data, store, compute=True, storage_options={"chunks": (64, 64)})
# File "/Users/wmoore/Desktop/python-scripts/zarr_scripts/test_dask_to_zarr.py", line 46, in <module>
# da.to_zarr(dask_data, store, compute=True, storage_options={"chunks": (64, 64)})
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/dask/array/core.py", line 3891, in to_zarr
# store = zarr.storage.FsspecStore.from_url(
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/zarr/storage/_fsspec.py", line 174, in from_url
# fs, path = url_to_fs(url, **opts)
# ^^^^^^^^^^^^^^^^^^^^^^
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/fsspec/core.py", line 403, in url_to_fs
# chain = _un_chain(url, kwargs)
# ^^^^^^^^^^^^^^^^^^^^^^
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/fsspec/core.py", line 335, in _un_chain
# if "::" in path:
# ^^^^^^^^^^^^
# TypeError: argument of type 'LocalStore' is not iterable
And also tried with FsspecStore:
store = zarr.storage.FsspecStore("test_dask_to_zarr.zarr", read_only=False)
da.to_zarr(dask_data, store, compute=True, storage_options={"chunks": (64, 64)})
# Traceback (most recent call last):
# File "/Users/wmoore/Desktop/python-scripts/zarr_scripts/test_dask_to_zarr.py", line 32, in <module>
# store = zarr.storage.FsspecStore("test_dask_to_zarr_v3.zarr", read_only=False)
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# File "/Users/wmoore/opt/anaconda3/envs/zarrv3_py312/lib/python3.12/site-packages/zarr/storage/_fsspec.py", line 95, in __init__
# if not self.fs.async_impl:
# ^^^^^^^^^^^^^^^^^^
# AttributeError: 'str' object has no attribute 'async_impl'
Many thanks for your help
Metadata
Metadata
Assignees
Labels
needs triageNeeds a response from a contributorNeeds a response from a contributor
Activity
joshmoore commentedon Jan 28, 2025
zarr-developers/zarr-python#2554 would imply that you need a new release of zarr-python with zarr-developers/zarr-python#2533
will-moore commentedon Jan 29, 2025
Thanks @joshmoore
I updated to use
mainbranch ofzarr-python:This:
now gives me:
will-moore commentedon Jan 30, 2025
The other 2 tests above, using
LocalStoreorFsspecStorestill have the same errors as before (no change wtih zarr-developers/zarr-python#2533)will-moore commentedon Mar 13, 2025
If I use
"auto_mkdir": Trueinstorage_optionsas suggested at zarr-developers/zarr-python#2808 (comment) then this looks good!