Skip to content

Issue Opening Files via SFTP with fsspec in Zarr v3 #3196

Open
@dgegen

Description

@dgegen

I'm currently using Zarr and fsspec to access a Zarr file stored on a server via SFTP. However, I've encountered an issue while transitioning from Zarr v2 to v3.

Description

import zarr
import fsspec

# Specify the SFTP filesystem
storage_options = {
    "key_filename": "/path/to/key",
    "username": "username",
    "host": "host",
}
sftp_fs = fsspec.filesystem('sftp', **storage_options)
zarr_path = "/path/to/file/on/server.zarr"

fs_map = fsspec.FSMap(zarr_path, sftp_fs)

print(f"File exists: {sftp_fs.exists(zarr_path)}")  # True

In Zarr v2.18.3 I am able to open this file using

# Zarr v2.18.3
zarr_file = zarr.open(fs_map)

Now, attempting to achieve the same thing using Zarr v3.0.9 (including an additional import because of #3195), I use:

# Zarr v3.0.9
import fsspec.implementations.asyn_wrapper  # missing import in zarr.storage.FsspecStore
from zarr.storage import FsspecStore

store = FsspecStore.from_mapper(fs_map, read_only=True)
zarr_file = zarr.open(store)

However, the call zarr_file = zarr.open(store), never finishes, i.e. Python freezes.

Is this a bug? Or will SFPT no longer be supported in Zarr v3? Or am I using FsspecStore incorrectly?

Thanks a lot in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions