Skip to content

Commit

Permalink
Switch to array_keys
Browse files Browse the repository at this point in the history
tuple(*.keys()) calls __len__ *and* __iter__
  • Loading branch information
dcherian committed Nov 29, 2023
1 parent 856d454 commit bb76e8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def store(
"""
import zarr

existing_keys = tuple(self.zarr_group.keys())
existing_keys = tuple(self.zarr_group.array_keys())
existing_variable_names = {
vn for vn in variables if _encode_variable_name(vn) in existing_keys
}
Expand Down Expand Up @@ -668,7 +668,7 @@ def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=No

import zarr

existing_keys = tuple(self.zarr_group.keys())
existing_keys = tuple(self.zarr_group.array_keys())

for vn, v in variables.items():
name = _encode_variable_name(vn)
Expand Down

0 comments on commit bb76e8d

Please sign in to comment.