From 6a93f6e67a09501425ef185c89d75a940bcfa847 Mon Sep 17 00:00:00 2001 From: michaelxer Date: Mon, 15 Jun 2026 14:56:07 +0700 Subject: [PATCH] fix: revert check_and_fix_namespace type signature to str to fix MyPy downstream errors --- litellm/caching/redis_cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/caching/redis_cache.py b/litellm/caching/redis_cache.py index ed0a22d78a7..263e1df2ee7 100644 --- a/litellm/caching/redis_cache.py +++ b/litellm/caching/redis_cache.py @@ -365,12 +365,12 @@ class RedisCache(BaseCache): self.redis_async_client = redis_async_client # type: ignore return redis_async_client - def check_and_fix_namespace(self, key: Optional[str]) -> Optional[str]: + def check_and_fix_namespace(self, key: str) -> str: """ Make sure each key starts with the given namespace """ if key is None: - return key + return key # type: ignore[return-value] if self.namespace is not None and not key.startswith(self.namespace): key = self.namespace + ":" + key