From 0f241a28c4f77dc56ffa2a4ed2e942c05675d351 Mon Sep 17 00:00:00 2001 From: Aarkin7 Date: Thu, 4 Jun 2026 21:34:40 +0530 Subject: [PATCH] fix(router): widen _remove_deployment_from_wildcard_state to Optional[str] Moving the call out of the inner `deployment_id in deployment_fast_mapping` block in the previous commit lost mypy's narrowing of `deployment_id` from Optional[str] to str, tripping the lint CI. The helper already handles None via its falsy guard, so widening the annotation matches the actual contract. --- litellm/router.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/router.py b/litellm/router.py index 44b00739d89..c3c4172d1fd 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -8733,7 +8733,7 @@ class Router: except Exception: return None - def _remove_deployment_from_wildcard_state(self, model_id: str) -> None: + def _remove_deployment_from_wildcard_state(self, model_id: Optional[str]) -> None: """ Drop every reference to model_id from the wildcard-routing data structures. Without this, upsert/delete leaves stale credentials in