2525import zarr
2626from zarr .abc .codec import ArrayArrayCodec , ArrayBytesCodec , BytesBytesCodec , Codec
2727from zarr .abc .numcodec import Numcodec , _is_numcodec
28+ from zarr .abc .store import SyncByteGetter
2829from zarr .codecs ._v2 import V2Codec
2930from zarr .codecs .bytes import BytesCodec
3031from zarr .codecs .vlen_utf8 import VLenBytesCodec , VLenUTF8Codec
@@ -1982,8 +1983,9 @@ def _can_use_sync_path(self) -> bool:
19821983 implement ``SupportsSyncCodec``). This is True for
19831984 BatchedCodecPipeline when all codecs support sync.
19841985
1985- 2. The store supports synchronous operations (has ``get_sync``).
1986- MemoryStore and LocalStore provide this; remote stores do not.
1986+ 2. The store supports synchronous operations (implements
1987+ ``SyncByteGetter``). MemoryStore and LocalStore provide this;
1988+ remote stores do not.
19871989
19881990 When both hold, the selection methods below call
19891991 _get_selection_sync / _set_selection_sync directly, running the
@@ -1993,7 +1995,7 @@ def _can_use_sync_path(self) -> bool:
19931995 """
19941996 pipeline = self .async_array .codec_pipeline
19951997 store = self .async_array .store_path .store
1996- return getattr (pipeline , "supports_sync_io" , False ) and hasattr (store , "get_sync" )
1998+ return getattr (pipeline , "supports_sync_io" , False ) and isinstance (store , SyncByteGetter )
19971999
19982000 @classmethod
19992001 @deprecated ("Use zarr.create_array instead." , category = ZarrDeprecationWarning )
@@ -3088,8 +3090,8 @@ def get_basic_selection(
30883090 prototype = prototype ,
30893091 )
30903092 # Fallback: submit the async coroutine to the background event loop
3091- # thread via sync(). Used for remote stores, sharded arrays, or when
3092- # SyncCodecPipeline is not active.
3093+ # thread via sync(). Used for remote stores or when the sync bypass
3094+ # is not active.
30933095 return sync (
30943096 self .async_array ._get_selection (
30953097 indexer ,
0 commit comments