Skip to content

Commit

Permalink
fix(zarr): use inplace array.resize for zarr 2 and 3 (#9673)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Nicholas <tom@cworthy.org>
  • Loading branch information
jhamman and TomNicholas authored Oct 24, 2024
1 parent 1f5889a commit 5b2e6f1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,10 +996,7 @@ def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=No

new_shape = list(zarr_array.shape)
new_shape[append_axis] += v.shape[append_axis]
if _zarr_v3():
zarr_array = zarr_array.resize(new_shape)
else:
zarr_array.resize(new_shape)
zarr_array.resize(new_shape)

zarr_shape = zarr_array.shape

Expand Down

0 comments on commit 5b2e6f1

Please sign in to comment.