Skip to content

zarr v3 and _strip_protocol() - which doesn't strip the protocol #14

@fjansson

Description

@fjansson

I'm trying to use xarray ds.to_zarr() to directly upload to a swift store (DKRZ), and I'm using zarr v3 (fresh pip install in virtual environment yesterday). I want to do something like this:

import xarray as xr
import zarr
import swiftspec
...
url='swift://swift.dkrz.de/some-path/'                                                                                                           
store = zarr.storage.FsspecStore.from_url(url, read_only=False)
ds.to_zarr(store, encoding=encoding, mode='w')

but from_url fails with ValueError: path argument to FsspecStore must not include scheme (swift://)

I posted this as an zarr-python issue here: zarr-developers/zarr-python#3201 with the answer that this happens because switfspec's _strip_protocol() doesn't actually remove swift:// from the URL.

Also when directly passing the url to ds.to_zarr(), I get the same error. Is this something that could be addressed in swiftspec, to make zarr v3 work with SWIFT?

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