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

Improve stores #86

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion ypy_websocket/stores/file_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def exists(self, path: str) -> bool:

return await anyio.Path(self._get_document_path(path)).exists()

async def list(self) -> AsyncIterator[str]:
async def list(self) -> AsyncIterator[str]: # type: ignore[override]
hbcarlos marked this conversation as resolved.
Show resolved Hide resolved
"""
Returns a list with the name/path of the documents stored.
"""
Expand Down
6 changes: 3 additions & 3 deletions ypy_websocket/stores/sqlite_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import time
from logging import Logger, getLogger
from typing import AsyncIterator, Awaitable, Callable
from typing import Any, AsyncIterator, Awaitable, Callable

import aiosqlite
import anyio
Expand Down Expand Up @@ -130,7 +130,7 @@ async def exists(self, path: str) -> bool:
)
return (await cursor.fetchone()) is not None

async def list(self) -> AsyncIterator[str]:
async def list(self) -> AsyncIterator[str]: # type: ignore[override]
hbcarlos marked this conversation as resolved.
Show resolved Hide resolved
"""
Returns a list with the name/path of the documents stored.
"""
Expand Down Expand Up @@ -166,7 +166,7 @@ async def get(self, path: str, updates: bool = False) -> dict | None:
if doc is None:
return None

list_updates = []
list_updates: Any = []
hbcarlos marked this conversation as resolved.
Show resolved Hide resolved
if updates:
cursor = await db.execute(
"SELECT yupdate, metadata, timestamp FROM yupdates WHERE path = ?",
Expand Down
Loading