Update type annotations and upgrade mypy (#173)

This commit is contained in:
Sebastián Ramírez
2021-11-30 17:12:28 +01:00
committed by GitHub
parent 02da85c9ec
commit e30c7ef4e9
10 changed files with 90 additions and 76 deletions

View File

@@ -136,4 +136,4 @@ def create_engine(
if not isinstance(query_cache_size, _DefaultPlaceholder):
current_kwargs["query_cache_size"] = query_cache_size
current_kwargs.update(kwargs)
return _create_engine(url, **current_kwargs)
return _create_engine(url, **current_kwargs) # type: ignore

View File

@@ -23,7 +23,7 @@ class ScalarResult(_ScalarResult, Generic[_T]):
return super().__iter__()
def __next__(self) -> _T:
return super().__next__()
return super().__next__() # type: ignore
def first(self) -> Optional[_T]:
return super().first()
@@ -32,7 +32,7 @@ class ScalarResult(_ScalarResult, Generic[_T]):
return super().one_or_none()
def one(self) -> _T:
return super().one()
return super().one() # type: ignore
class Result(_Result, Generic[_T]):
@@ -70,10 +70,10 @@ class Result(_Result, Generic[_T]):
return super().scalar_one() # type: ignore
def scalar_one_or_none(self) -> Optional[_T]:
return super().scalar_one_or_none() # type: ignore
return super().scalar_one_or_none()
def one(self) -> _T: # type: ignore
return super().one() # type: ignore
def scalar(self) -> Optional[_T]:
return super().scalar() # type: ignore
return super().scalar()