From 9d1fcc618fd41df8361263a4f5497c24f576d3cc Mon Sep 17 00:00:00 2001 From: michaelxer Date: Mon, 15 Jun 2026 11:07:22 +0700 Subject: [PATCH] fix: update type annotations for check_and_fix_namespace - key: str -> Optional[str] (now handles None input) - return: str -> Optional[str] (returns None when input is None) Addresses Greptile review concern about type signature mismatch. --- litellm/caching/redis_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/caching/redis_cache.py b/litellm/caching/redis_cache.py index 83dfddfba1a..ed0a22d78a7 100644 --- a/litellm/caching/redis_cache.py +++ b/litellm/caching/redis_cache.py @@ -365,7 +365,7 @@ class RedisCache(BaseCache): self.redis_async_client = redis_async_client # type: ignore return redis_async_client - def check_and_fix_namespace(self, key: str) -> str: + def check_and_fix_namespace(self, key: Optional[str]) -> Optional[str]: """ Make sure each key starts with the given namespace """