Skip to content

Universal-pathlib support for zarr.open #4244

Description

@mark-boer

Describe the new feature you'd like

In the past I'd use code as follows:

import xarray as xr
from upath import UPath

s3_path = UPath("s3://my-bucket/my-key.zarr/")
ds = xr.open_dataarray(s3_path, engine="zarr", chunks={})

This recently stopped working (I think because upath.S3Path no longer implements __fspath__, not entirely sure though).

Right now xarray just passes the upath directly to zarr.open(). Personally I think it would make sense that the zarr.open supports a UPath as a parameter, seeing that universal-pathlib is already an optional dependency.

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