betodealmeida commented on code in PR #34831:
URL: https://github.com/apache/superset/pull/34831#discussion_r2298684567
##########
docker/pythonpath_dev/superset_config.py:
##########
@@ -49,11 +49,19 @@
f"{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_DB}"
)
-SQLALCHEMY_EXAMPLES_URI = (
- f"{DATABASE_DIALECT}://"
- f"{EXAMPLES_USER}:{EXAMPLES_PASSWORD}@"
- f"{EXAMPLES_HOST}:{EXAMPLES_PORT}/{EXAMPLES_DB}"
-)
+# Use environment variable if set, otherwise construct from components
+# This MUST take precedence over any other configuration
+_examples_uri_env = os.getenv("SUPERSET__SQLALCHEMY_EXAMPLES_URI")
+if _examples_uri_env:
+ SQLALCHEMY_EXAMPLES_URI = _examples_uri_env
+else:
+ # Fallback to PostgreSQL construction only if env var not set
+ SQLALCHEMY_EXAMPLES_URI = (
+ f"{DATABASE_DIALECT}://"
+ f"{EXAMPLES_USER}:{EXAMPLES_PASSWORD}@"
+ f"{EXAMPLES_HOST}:{EXAMPLES_PORT}/{EXAMPLES_DB}"
+ )
Review Comment:
```suggestion
SQLALCHEMY_EXAMPLES_URI = os.getenv(
"SUPERSET__SQLALCHEMY_EXAMPLES_URI",
(
f"{DATABASE_DIALECT}://"
f"{EXAMPLES_USER}:{EXAMPLES_PASSWORD}@"
f"{EXAMPLES_HOST}:{EXAMPLES_PORT}/{EXAMPLES_DB}"
),
)
```
--
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]