villebro commented on code in PR #29912:
URL: https://github.com/apache/superset/pull/29912#discussion_r1738836361


##########
superset/async_events/async_query_manager.py:
##########
@@ -55,13 +66,32 @@ def parse_event(event_data: tuple[str, dict[str, Any]]) -> 
dict[str, Any]:
     return {"id": event_id, **json.loads(event_payload)}
 
 
-def increment_id(redis_id: str) -> str:
+def increment_id(entry_id: str) -> str:
     # redis stream IDs are in this format: '1607477697866-0'
     try:
-        prefix, last = redis_id[:-1], int(redis_id[-1])
+        prefix, last = entry_id[:-1], int(entry_id[-1])
         return prefix + str(last + 1)
     except Exception:  # pylint: disable=broad-except
-        return redis_id
+        return entry_id
+
+
+def get_cache_backend(
+    config: dict[str, Any],
+) -> Union[RedisCacheBackend, RedisSentinelCacheBackend, redis.Redis]:  # 
type: ignore

Review Comment:
   nit: the new type annotations support this simpler format:
   ```suggestion
   ) -> RedisCacheBackend | RedisSentinelCacheBackend | redis.Redis:  # type: 
ignore
   ```



##########
superset/async_events/async_query_manager.py:
##########
@@ -73,7 +103,7 @@ class AsyncQueryManager:
 
     def __init__(self) -> None:
         super().__init__()
-        self._redis: redis.Redis  # type: ignore
+        self._cache: Optional[BaseCache] = None

Review Comment:
   Same here:
   ```suggestion
           self._cache: BaseCache | None = None
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to