From b8d7ddc42a107c3e1bd1b710d184fb23381ff11c Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 1 Sep 2024 18:19:41 +0200 Subject: [PATCH] make sure to copy the data of the `DatetimeIndex` --- xarray/tests/test_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index f2e712e334c..838185bc6b3 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -1217,7 +1217,7 @@ def test_chunk_by_frequency(self, freq: str, calendar: str, add_gap: bool) -> No ΔN = 28 time = xr.date_range( "2001-01-01", periods=N + ΔN, freq="D", calendar=calendar - ).to_numpy() + ).to_numpy(copy=True) if add_gap: # introduce an empty bin time[31 : 31 + ΔN] = np.datetime64("NaT")