Skip to content

Commit

Permalink
path / key normalization in set_variables
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Sep 30, 2024
1 parent 20c22bd commit 6087e5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,9 +892,13 @@ def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=No
else:
kwargs["store"] = self.zarr_group.chunk_store

# TODO: see if zarr should normalize these strings.
zarr_array = zarr.open(
**kwargs,
path=f"{self.zarr_group.name}/{name}",
# path=f"{self.zarr_group.name}/{name}",
path="/".join([self.zarr_group.name.rstrip("/"), name]).lstrip(
"/"
),
write_empty_chunks=self._write_empty,
)
else:
Expand Down

0 comments on commit 6087e5e

Please sign in to comment.