diff --git a/aql/column.py b/aql/column.py index b5acc50..80e082f 100644 --- a/aql/column.py +++ b/aql/column.py @@ -84,7 +84,7 @@ class Column: def __init__( self, name: str, - ctype: Type = None, + ctype: Optional[Type] = None, default: Any = NO_DEFAULT, table_name: str = "", ) -> None: diff --git a/aql/engines/base.py b/aql/engines/base.py index 6301d42..6ea9b55 100644 --- a/aql/engines/base.py +++ b/aql/engines/base.py @@ -200,7 +200,7 @@ def last_id(self) -> Optional[int]: """ID of last modified row, or None if not available.""" raise self._cursor.lastrowid - def convert(self, row) -> T: + def convert(self, row) -> T: # type: ignore[type-var] """Convert from the cursor's native data type to the query object type.""" if self._query: return self._query.table(row) diff --git a/aql/query.py b/aql/query.py index c5154d4..f36b5a7 100644 --- a/aql/query.py +++ b/aql/query.py @@ -201,7 +201,7 @@ def orderby(self, column: Column, *args: Union[Column, Order, str]) -> "Query[T] return self @only() - def limit(self, n: int, offset: int = None) -> "Query[T]": + def limit(self, n: int, offset: Optional[int] = None) -> "Query[T]": self._limit = n self._offset = offset return self diff --git a/aql/table.py b/aql/table.py index 5d76715..cf19c72 100644 --- a/aql/table.py +++ b/aql/table.py @@ -31,7 +31,10 @@ class Table(Generic[T]): """Table specification using custom columns and a source type.""" def __init__( - self, name: str, cons: Iterable[Union[Column, Index]], source: Type[T] = None + self, + name: str, + cons: Iterable[Union[Column, Index]], + source: Optional[Type[T]] = None, ) -> None: self._name = name self._columns: List[Column] = [] diff --git a/pyproject.toml b/pyproject.toml index 4a3499f..bdf8895 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ dev = [ "flake8==7", "flake8-bugbear==24.4.21", "flit==3.9.0", - "mypy==0.931", + "mypy==1.9.0", "usort==1.0.8.post1", ] docs = [