Skip to content

Commit 3b06c53

Browse files
committed
Move imports
1 parent d0a753d commit 3b06c53

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/zarr/storage/_fsspec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
from __future__ import annotations
22

3+
import json
34
import warnings
45
from contextlib import suppress
56
from typing import TYPE_CHECKING, Any
67

8+
from packaging.version import parse as parse_version
9+
710
from zarr.abc.store import (
811
ByteRequest,
912
OffsetByteRequest,
@@ -42,16 +45,13 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem:
4245
is wrapped with AsyncFileSystemWrapper.
4346
"""
4447
import fsspec
45-
from packaging.version import parse as parse_version
4648

4749
fsspec_version = parse_version(fsspec.__version__)
4850
if fs.async_impl and fs.asynchronous:
4951
# Already an async instance of an async filesystem, nothing to do
5052
return fs
5153
if fs.async_impl:
5254
# Convert sync instance of an async fs to an async instance
53-
import json
54-
5555
fs_dict = json.loads(fs.to_json())
5656
fs_dict["asynchronous"] = True
5757
return fsspec.AbstractFileSystem.from_json(json.dumps(fs_dict))

0 commit comments

Comments
 (0)