remove allow-untyped-defs from _export/db/logging.py (#144093)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/144093
Approved by: https://github.com/Skylion007
This commit is contained in:
bobrenjc93 2025-01-02 11:35:43 -08:00 committed by PyTorch MergeBot
parent ad09395674
commit e9e18a9617

View File

@ -1,7 +1,6 @@
# mypy: allow-untyped-defs
from typing import Optional
def exportdb_error_message(case_name: str):
def exportdb_error_message(case_name: str) -> str:
from .examples import all_examples
from torch._utils_internal import log_export_usage
@ -19,7 +18,7 @@ def exportdb_error_message(case_name: str):
return f"{case_name} is unsupported."
def get_class_if_classified_error(e):
def get_class_if_classified_error(e: Exception) -> Optional[str]:
"""
Returns a string case name if the export error e is classified.
Returns None otherwise.