mypy: Fix warn_return_any type errors
Add proper type annotations to fix mypy warn_return_any errors. The following files were modified to add cast() calls or return type annotations where functions returned Any values: - algo/ShuntingYard.py: Add cast for operator() return value - auth/Auth.py: Add cast for load() return value, fix imports - cast.py: Fix cast_str_to_int return type, fix _strip type - db/TableIoHandler.py: Remove redundant cast, fix store() return - db/query/Queries.py: Add cast for _run() and __getitem__ returns - db/query/Query.py: Add cast for db property return - db/query/QueryResult.py: Add cast for db and query property returns - db/schema/Schema.py: Add return type to __tables property, cast columns - db/schema/Table.py: Add cast for model_module_search_paths return - ev/app/EventRouter.py: Add cast for peer_conf.get() return - ev/base/Object.py: Add cast for get_conf_section and str_or_none returns - ev/base/SimpleObject.py: Add cast for create() return, fix imports - load_yaml.py: Add cast for _expand_links_recursive return - misc.py: Fix object_builtin_name return type, add param annotations - stree/StringTree.py: Fix get() return type with default_value variable Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f171443d49
commit
ec342ba172
1 changed files with 37 additions and 38 deletions
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
import abc
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from typing import TYPE_CHECKING, Any, cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..DataBase import DataBase
|
||||
|
|
@ -47,7 +47,7 @@ class Query(abc.ABC): # export
|
|||
|
||||
@property
|
||||
def db(self) -> DataBase:
|
||||
return self.__parent.db
|
||||
return cast('DataBase', self.__parent.db)
|
||||
|
||||
@property
|
||||
def schema(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue