tadeha opened a new pull request, #34327: URL: https://github.com/apache/superset/pull/34327
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> This feature introduces dynamic database connection support for Superset Helm Chart, allowing users to select between different database types like PostgreSQL (default) and MySQL. Previously, the SQLALCHEMY_DATABASE_URI was hardcoded to postgresql+psycopg2. This enhancement enables the database backend to be configured directly through `values.yaml`. The `supersetNode.connections.db_type` option controls which database type Superset will connect to. This change is fully backward compatible: If `supersetNode.connections.db_type` is not explicitly set in `values.yaml` (as would be the case for existing deployments), it defaults to "postgresql", preserving current functionality. Validation is included to prevent unsupported database_type values from being deployed. ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. **To test PostgreSQL (Default Behavior):** * Ensure `supersetNode.connections.db_type` is either commented out or set to `"postgresql"` in `values.yaml`. * Install/Upgrade Helm chart: `helm upgrade --install superset .` * Verify Superset successfully connects to PostgreSQL. 2. **To test MySQL:** * **Prepare your Superset Image:** Build a custom Superset Docker image that includes the `mysqlclient` Python package (e.g., by adding `RUN pip install mysqlclient` after installing build dependencies like `default-libmysqlclient-dev`). Update your `values.yaml` to use this new image. * In `values.yaml`, set `supersetNode.connections.db_type: "mysql"`. * Configure your MySQL connection details: * Set `supersetNode.connections.db_host` to your MySQL server's host. * Set `supersetNode.connections.db_user`, `db_pass`, `db_name`, `db_port` for your MySQL database. * Install/Upgrade Helm chart: `helm upgrade --install superset .` * Verify Superset successfully connects to MySQL. 3. **To test Validation (Unsupported Type):** * In `values.yaml`, set `supersetNode.connections.db_type: "unsupported_db_type"`. * Attempt to install/upgrade Helm chart: `helm upgrade --install superset .` * Verify that the Helm command **fails** with an error message indicating an unsupported `database_type`. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [x] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
