lint(cost): justify blind except in _lookup_model_info_or_none

get_model_info raises a bare Exception for unmapped models, so BLE001 cannot
be narrowed; mark it noqa with the reason to stay within the strict budget.
This commit is contained in:
mubashir1osmani 2026-09-17 15:43:46 -04:00
parent d2af0577d5
commit 4e4008cea9

View file

@ -2170,7 +2170,7 @@ def ocr_batch_cost(
def _lookup_model_info_or_none(model: str, custom_llm_provider: str | None) -> ModelInfo | None:
try:
return litellm.get_model_info(model=model, custom_llm_provider=custom_llm_provider)
except Exception:
except Exception: # noqa: BLE001 # get_model_info raises bare Exception for unmapped models; caller logs and bills 0.0
return None