diff --git a/src/quart_db/backends/aiosqlite.py b/src/quart_db/backends/aiosqlite.py index 7282570..5c0b59c 100644 --- a/src/quart_db/backends/aiosqlite.py +++ b/src/quart_db/backends/aiosqlite.py @@ -125,7 +125,7 @@ async def fetch_val( else: return result[0] - async def iterate( # type: ignore[override] + async def iterate( self, query: str, values: Optional[Dict[str, Any]] = None, diff --git a/src/quart_db/backends/asyncpg.py b/src/quart_db/backends/asyncpg.py index bddd435..84ddf1e 100644 --- a/src/quart_db/backends/asyncpg.py +++ b/src/quart_db/backends/asyncpg.py @@ -119,7 +119,7 @@ async def fetch_val( except asyncpg.exceptions.UndefinedParameterError as error: raise UndefinedParameterError(str(error)) - async def iterate( # type: ignore[override] + async def iterate( self, query: str, values: Optional[Dict[str, Any]] = None, diff --git a/src/quart_db/interfaces.py b/src/quart_db/interfaces.py index 96fcc45..cc95d19 100644 --- a/src/quart_db/interfaces.py +++ b/src/quart_db/interfaces.py @@ -93,7 +93,7 @@ async def fetch_val(self, query: str, values: Optional[Dict[str, Any]] = None) - pass @abstractmethod - async def iterate( + def iterate( self, query: str, values: Optional[Dict[str, Any]] = None, diff --git a/tests/test_connection.py b/tests/test_connection.py index 6c70c74..a0b6f00 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -35,10 +35,7 @@ async def test_iterate(connection: Connection) -> None: "INSERT INTO tbl (data) VALUES (:data)", [{"data": 2}, {"data": 3}], ) - assert [2, 3] == [ - result["data"] - async for result in connection.iterate("SELECT data FROM tbl") # type: ignore - ] + assert [2, 3] == [result["data"] async for result in connection.iterate("SELECT data FROM tbl")] async def test_transaction(connection: Connection) -> None: