refactor: clean type: ignore comments in login.py and template_transformer.py (#30510)

Signed-off-by: majiayu000 <1835304752@qq.com>
This commit is contained in:
lif
2026-01-06 14:33:27 +08:00
committed by GitHub
parent 4f74e90f51
commit f3ca8be9f9
2 changed files with 9 additions and 8 deletions

View File

@ -76,7 +76,7 @@ class TemplateTransformer(ABC):
Post-process the result to convert scientific notation strings back to numbers
"""
def convert_scientific_notation(value):
def convert_scientific_notation(value: Any) -> Any:
if isinstance(value, str):
# Check if the string looks like scientific notation
if re.match(r"^-?\d+\.?\d*e[+-]\d+$", value, re.IGNORECASE):
@ -90,7 +90,7 @@ class TemplateTransformer(ABC):
return [convert_scientific_notation(v) for v in value]
return value
return convert_scientific_notation(result) # type: ignore[no-any-return]
return convert_scientific_notation(result)
@classmethod
@abstractmethod