added mypy checks and some typehint changes to conform

This commit is contained in:
collerek
2020-09-29 14:05:08 +02:00
parent 6d56ea5e30
commit 3caa87057e
23 changed files with 274 additions and 202 deletions

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Tuple, Type, Union
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Tuple, Type
import sqlalchemy
from sqlalchemy import text
@ -118,7 +118,7 @@ class QueryClause:
def _determine_filter_target_table(
self, related_parts: List[str], select_related: List[str]
) -> Tuple[List[str], str, "Model"]:
) -> Tuple[List[str], str, Type["Model"]]:
table_prefix = ""
model_cls = self.model_cls
@ -168,9 +168,7 @@ class QueryClause:
return clause
@staticmethod
def _escape_characters_in_clause(
op: str, value: Union[str, "Model"]
) -> Tuple[str, bool]:
def _escape_characters_in_clause(op: str, value: Any) -> Tuple[Any, bool]:
has_escaped_character = False
if op not in [