From 95987975dfca6e615dd91040a8e251d86121963f Mon Sep 17 00:00:00 2001 From: Altay Sansal Date: Wed, 2 Jul 2025 09:42:45 -0500 Subject: [PATCH 1/5] Add missing import for AsyncFileSystemWrapper in `_fsspec.py` --- src/zarr/storage/_fsspec.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index 4f6929456e..6a8d9f5267 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -45,6 +45,7 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem: is wrapped with AsyncFileSystemWrapper. """ import fsspec + import fsspec.implementations.asyn_wrapper fsspec_version = parse_version(fsspec.__version__) if fs.async_impl and fs.asynchronous: From d9f7aef15e900f8cd386542b668c715a68e9cdbe Mon Sep 17 00:00:00 2001 From: Altay Sansal Date: Wed, 2 Jul 2025 09:48:25 -0500 Subject: [PATCH 2/5] Add missing changelog entry for AsyncFileSystemWrapper import fix --- changes/3195.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/3195.bugfix.rst diff --git a/changes/3195.bugfix.rst b/changes/3195.bugfix.rst new file mode 100644 index 0000000000..44a7ce9105 --- /dev/null +++ b/changes/3195.bugfix.rst @@ -0,0 +1 @@ +Add missing import for AsyncFileSystemWrapper for _make_async in _fsspec.py \ No newline at end of file From 965f96268a305b6df99510afdf3e1eaedc259624 Mon Sep 17 00:00:00 2001 From: Altay Sansal Date: Wed, 2 Jul 2025 10:18:16 -0500 Subject: [PATCH 3/5] Move AsyncFileSystemWrapper import past the version check in `_fsspec.py` --- src/zarr/storage/_fsspec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index 6a8d9f5267..b6b711689e 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -45,7 +45,6 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem: is wrapped with AsyncFileSystemWrapper. """ import fsspec - import fsspec.implementations.asyn_wrapper fsspec_version = parse_version(fsspec.__version__) if fs.async_impl and fs.asynchronous: @@ -69,6 +68,7 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem: "2024.12.0 or later to enable this functionality." ) + import fsspec.implementations.asyn_wrapper return fsspec.implementations.asyn_wrapper.AsyncFileSystemWrapper(fs, asynchronous=True) From e0999b2a68616af49e155aa536c3d12a4e9657da Mon Sep 17 00:00:00 2001 From: Altay Sansal Date: Wed, 2 Jul 2025 10:25:43 -0500 Subject: [PATCH 4/5] Add newline after AsyncFileSystemWrapper import in `_fsspec.py` --- src/zarr/storage/_fsspec.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index b6b711689e..79ab1c8833 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -69,6 +69,7 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem: ) import fsspec.implementations.asyn_wrapper + return fsspec.implementations.asyn_wrapper.AsyncFileSystemWrapper(fs, asynchronous=True) From a3b97ac1f961d284f29455de07a2184c0659c8ed Mon Sep 17 00:00:00 2001 From: Altay Sansal Date: Wed, 2 Jul 2025 13:22:15 -0500 Subject: [PATCH 5/5] Simplify import statement for AsyncFileSystemWrapper in `_fsspec.py` --- src/zarr/storage/_fsspec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index 79ab1c8833..0d854b0561 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -68,9 +68,9 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem: "2024.12.0 or later to enable this functionality." ) - import fsspec.implementations.asyn_wrapper + from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper - return fsspec.implementations.asyn_wrapper.AsyncFileSystemWrapper(fs, asynchronous=True) + return AsyncFileSystemWrapper(fs, asynchronous=True) class FsspecStore(Store):