fix: revert check_and_fix_namespace type signature to str to fix MyPy downstream errors

This commit is contained in:
michaelxer 2026-06-15 14:56:07 +07:00
parent 9d1fcc618f
commit 6a93f6e67a

View file

@ -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