Skip to content

Commit e2cbc23

Browse files
committed
* Cache result of FSStore._fsspec_installed
Prevent runtime-overhead in doing this check multiple times
1 parent 039d3ba commit e2cbc23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

zarr/storage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import zipfile
2929
from collections import OrderedDict
3030
from collections.abc import MutableMapping
31+
from functools import cache
3132
from os import scandir
3233
from pickle import PicklingError
3334
from threading import Lock, RLock
@@ -1540,6 +1541,7 @@ def clear(self):
15401541
self.map.clear()
15411542

15421543
@classmethod
1544+
@cache
15431545
def _fsspec_installed(cls):
15441546
"""Returns true if fsspec is installed"""
15451547
import importlib.util

0 commit comments

Comments
 (0)