From 5b2e6f1895c8c31dd2b3cecf1117f2b166e14b9a Mon Sep 17 00:00:00 2001 From: Joe Hamman Date: Thu, 24 Oct 2024 12:32:24 -0700 Subject: [PATCH] fix(zarr): use inplace array.resize for zarr 2 and 3 (#9673) Co-authored-by: Tom Nicholas --- xarray/backends/zarr.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/xarray/backends/zarr.py b/xarray/backends/zarr.py index 50755ebf1f7..75a39f9306d 100644 --- a/xarray/backends/zarr.py +++ b/xarray/backends/zarr.py @@ -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