diff --git a/lib/dl_formula/dl_formula/shortcuts.py b/lib/dl_formula/dl_formula/shortcuts.py index f4fa6f905..5fedf10de 100644 --- a/lib/dl_formula/dl_formula/shortcuts.py +++ b/lib/dl_formula/dl_formula/shortcuts.py @@ -4,6 +4,7 @@ import datetime as datetime_mod from functools import wraps from typing import ( + Any, FrozenSet, List, Optional, @@ -36,7 +37,7 @@ def wrapper(self, value): # type: ignore # 2024-01-24 # TODO: Function is miss return decorator -def _norm(value) -> nodes.FormulaItem: # type: ignore # 2024-01-24 # TODO: Function is missing a type annotation for one or more arguments [no-untyped-def] +def _norm(value: Any) -> nodes.FormulaItem: if not isinstance(value, nodes.FormulaItem): value = n.lit(value) return value @@ -60,7 +61,7 @@ class NodeShortcut: type(None), ) ) - def lit(self, value) -> Union[nodes.BaseLiteral, nodes.Null]: # type: ignore # 2024-01-24 # TODO: Function is missing a type annotation for one or more arguments [no-untyped-def] + def lit(self, value: Any) -> Union[nodes.BaseLiteral, nodes.Null]: if isinstance(value, str): return self.str(value) if isinstance(value, bool): @@ -240,13 +241,13 @@ def wrapper( wfunc = FuncShortcut(assume_window=True) # same, but always results in a window function class WhenProxy: - def __init__(self, val): # type: ignore # 2024-01-24 # TODO: Function is missing a type annotation [no-untyped-def] + def __init__(self, val: Any) -> None: self._val = val - def then(self, expr) -> nodes.WhenPart: # type: ignore # 2024-01-24 # TODO: Function is missing a type annotation for one or more arguments [no-untyped-def] + def then(self, expr: Any) -> nodes.WhenPart: return nodes.WhenPart.make(val=_norm(self._val), expr=_norm(expr)) - def when(self, val) -> "NodeShortcut.WhenProxy": # type: ignore # 2024-01-24 # TODO: Function is missing a type annotation for one or more arguments [no-untyped-def] + def when(self, val: Any) -> "NodeShortcut.WhenProxy": return self.WhenProxy(val) class CaseProxy: