Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return type of kv.keys #135

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions nitric/resources/kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
from __future__ import annotations

from typing import Any, List, Literal, AsyncIterator, Optional
from typing import Any, List, Literal, AsyncGenerator, Optional

from grpclib import GRPCError
from grpclib.client import Channel
Expand Down Expand Up @@ -87,7 +87,7 @@ async def get(self, key: str) -> dict[str, Any]:
except GRPCError as grpc_err:
raise exception_from_grpc_error(grpc_err) from grpc_err

async def keys(self, prefix: Optional[str] = "") -> AsyncIterator[str]:
async def keys(self, prefix: Optional[str] = "") -> AsyncGenerator[str, None]:
"""Return a list of keys from the key value store."""
if prefix is None:
prefix = ""
Expand All @@ -104,8 +104,6 @@ async def keys(self, prefix: Optional[str] = "") -> AsyncIterator[str]:
except GRPCError as grpc_err:
raise exception_from_grpc_error(grpc_err) from grpc_err

return

async def delete(self, key: str) -> None:
"""Delete a key from the key value store."""
ref = ValueRef(store=self.name, key=key)
Expand Down
Loading