Skip to content

Commit 6087e5e

Browse files
committed
path / key normalization in set_variables
1 parent 20c22bd commit 6087e5e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xarray/backends/zarr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,9 +892,13 @@ def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=No
892892
else:
893893
kwargs["store"] = self.zarr_group.chunk_store
894894

895+
# TODO: see if zarr should normalize these strings.
895896
zarr_array = zarr.open(
896897
**kwargs,
897-
path=f"{self.zarr_group.name}/{name}",
898+
# path=f"{self.zarr_group.name}/{name}",
899+
path="/".join([self.zarr_group.name.rstrip("/"), name]).lstrip(
900+
"/"
901+
),
898902
write_empty_chunks=self._write_empty,
899903
)
900904
else:

0 commit comments

Comments
 (0)