fix: add type: ignore for redis.scan() mypy false positive in cache.py

redis.Redis.scan() returns a tuple at runtime but mypy infers
Awaitable[Any] from the generic ResponseT return type, causing
a "not iterable" error on tuple unpacking.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-01 15:22:50 +00:00
parent febdf41469
commit d45d0a424e
+1 -1
View File
@@ -113,7 +113,7 @@ def cache_delete_pattern(pattern: str) -> None:
full_pattern = f"{_KEY_PREFIX}{pattern}"
cursor = 0
while True:
cursor, keys = client.scan(cursor, match=full_pattern, count=100)
cursor, keys = client.scan(cursor, match=full_pattern, count=100) # type: ignore[misc] # sync Redis returns tuple
if keys:
client.delete(*keys)
if cursor == 0: