c-w commented on code in PR #29499:
URL: https://github.com/apache/superset/pull/29499#discussion_r1671271170


##########
docker/pythonpath_dev/superset_config.py:
##########
@@ -58,24 +59,41 @@
 REDIS_PORT = os.getenv("REDIS_PORT", "6379")
 REDIS_CELERY_DB = os.getenv("REDIS_CELERY_DB", "0")
 REDIS_RESULTS_DB = os.getenv("REDIS_RESULTS_DB", "1")
+REDIS_PROTO = os.getenv("REDIS_PROTO", "redis")
+REDIS_USER = os.getenv("REDIS_USER", "")
+REDIS_PASSWORD = os.getenv("REDIS_PASSWORD", "")
+
+REDIS_BASE_URL = (
+    f"{REDIS_PROTO}://{REDIS_USER}:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}"
+    if REDIS_PASSWORD
+    else f"{REDIS_PROTO}://{REDIS_HOST}:{REDIS_PORT}"
+)
 
-RESULTS_BACKEND = FileSystemCache("/app/superset_home/sqllab")
+if os.getenv("RESULTS_BACKEND_CACHE_TYPE") == "RedisCache":
+    RESULTS_BACKEND = RedisCache(
+        key_prefix="superset_results",
+        ssl=REDIS_PROTO == "rediss",
+        password=REDIS_PASSWORD or None,

Review Comment:
   This construct is there to cast the empty string to None to disable the 
password (as cachelib documents password as `str | None`), but technically it's 
not necessary as eventually redis-py will cast None back to the empty string 
anyway 
([here](https://github.com/redis/redis-py/blob/0be67bfdf609943e6ce8ecdb026c3234753bbfec/redis/credentials.py#L21))
 so this will do:
   
   ```suggestion
           password=REDIS_PASSWORD,
   ```
   
   Not applying the change for now pending the discussion about whether or not 
the PR is something that should be merged in the first place.



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