From 5fc54707ec8e46682e8b23085b1e7784c4100964 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Fri, 25 Aug 2023 12:49:27 -0400 Subject: [PATCH] fix bad test --- kerchunk/tests/test_utils.py | 2 +- kerchunk/utils.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kerchunk/tests/test_utils.py b/kerchunk/tests/test_utils.py index 4b34561f..afc35e6f 100644 --- a/kerchunk/tests/test_utils.py +++ b/kerchunk/tests/test_utils.py @@ -107,7 +107,7 @@ def test_subchunk_exact(m, chunks): out = kerchunk.utils.subchunk(ref, "data", 5) nchunk = 10 // chunks[0] * 5 - assert list(ref) == [".zgroup", "data/.zarray"] + [ + assert list(out) == [".zgroup", "data/.zarray"] + [ f"data/{_}.0" for _ in range(nchunk) ] diff --git a/kerchunk/utils.py b/kerchunk/utils.py index 40163110..c06f1ee9 100644 --- a/kerchunk/utils.py +++ b/kerchunk/utils.py @@ -237,6 +237,7 @@ def subchunk(store, variable, factor): modified store """ fs = fsspec.filesystem("reference", fo=store) + store = copy.deepcopy(store) meta_file = f"{variable}/.zarray" meta = ujson.loads(fs.cat(meta_file)) if meta["compressor"] is not None: