Skip to content

Commit

Permalink
Make methods of abstract base class async
Browse files Browse the repository at this point in the history
The goal is that the async methods of child classes match the signatures
of the methods of the abstract base class.
  • Loading branch information
DimitriPapadopoulos committed Oct 15, 2024
1 parent da675fe commit e86ee25
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/zarr/abc/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,17 @@ def supports_listing(self) -> bool:
...

@abstractmethod
def list(self) -> AsyncGenerator[str, None]:
async def list(self) -> AsyncGenerator[str, None]:
"""Retrieve all keys in the store.
Returns
-------
AsyncGenerator[str, None]
"""
...
yield # type: ignore[misc]

@abstractmethod
def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
async def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
"""
Retrieve all keys in the store that begin with a given prefix. Keys are returned with the
common leading prefix removed.
Expand All @@ -352,10 +352,10 @@ def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
-------
AsyncGenerator[str, None]
"""
...
yield # type: ignore[misc]

@abstractmethod
def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
async def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
"""
Retrieve all keys and prefixes with a given prefix and which do not contain the character
“/” after the given prefix.
Expand All @@ -368,7 +368,7 @@ def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
-------
AsyncGenerator[str, None]
"""
...
yield # type: ignore[misc]

def close(self) -> None:
"""Close the store."""
Expand Down

0 comments on commit e86ee25

Please sign in to comment.