From 36f0c84879c9a03711e642e8a8b40ed37d05e678 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Thu, 20 Feb 2025 08:52:01 -0500 Subject: [PATCH 1/3] refs_as_fs should set async on target --- kerchunk/utils.py | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/kerchunk/utils.py b/kerchunk/utils.py index b7ad4357..9b3c787d 100644 --- a/kerchunk/utils.py +++ b/kerchunk/utils.py @@ -26,6 +26,10 @@ def refs_as_fs( **kwargs, ): """Convert a reference set to an fsspec filesystem""" + if fs is not None: + if asynchronous and not fs.async_impl: + raise ValueError + fs.asynchronous = asynchronous fs = fsspec.filesystem( "reference", fo=refs, diff --git a/pyproject.toml b/pyproject.toml index 494a5b11..b383f04e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ dependencies = [ - "fsspec", + "fsspec>=2025.2.0", "numcodecs", "numpy", "ujson", From a05fd6022e65673fb8472d1515e5e9f354434d14 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Thu, 20 Feb 2025 09:31:17 -0500 Subject: [PATCH 2/3] fix one --- kerchunk/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/kerchunk/utils.py b/kerchunk/utils.py index 9b3c787d..d100b99c 100644 --- a/kerchunk/utils.py +++ b/kerchunk/utils.py @@ -27,8 +27,6 @@ def refs_as_fs( ): """Convert a reference set to an fsspec filesystem""" if fs is not None: - if asynchronous and not fs.async_impl: - raise ValueError fs.asynchronous = asynchronous fs = fsspec.filesystem( "reference", From b7cc0ef7fc81d0244855e332d6818db714909ffb Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Thu, 20 Feb 2025 11:11:21 -0500 Subject: [PATCH 3/3] fix inline temporary --- kerchunk/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kerchunk/utils.py b/kerchunk/utils.py index d100b99c..f525fe13 100644 --- a/kerchunk/utils.py +++ b/kerchunk/utils.py @@ -302,6 +302,7 @@ def _inline_array(group, threshold, names, prefix=""): cond2 = prefix1 in names if cond1 or cond2: original_attrs = dict(thing.attrs) + data = thing[:] arr = group.create_array( name=name, dtype=thing.dtype, @@ -310,7 +311,7 @@ def _inline_array(group, threshold, names, prefix=""): fill_value=thing.fill_value, overwrite=True, ) - arr[:] = thing[:] + arr[:] = data arr.attrs.update(original_attrs)