eschutho opened a new pull request, #44279:
URL: https://github.com/apache/superset/pull/44279

   ### SUMMARY
   
   Epic [sc-120993](https://app.shortcut.com/preset/story/120993) migrates DB 
connections to the new dynamic connection form, which appears when an engine 
spec defines a `parameters_schema`. This PR does that for **Apache Druid** 
(engine `druid`).
   
   Story: https://app.shortcut.com/preset/story/120998
   
   `DruidEngineSpec` now mixes in `BasicParametersMixin`, so 
`/api/v1/database/available/` returns individual connection parameters (host, 
port, username, password, encryption, extra query params) instead of the raw 
SQLAlchemy-URI box.
   
   **Design decisions**
   
   The pydruid SQLAlchemy URI is 
`druid://user:password@host:port/druid/v2/sql/`, which differs from the plain 
`BasicParametersMixin` pattern in two ways:
   
   - **Fixed SQL endpoint path** — the path `/druid/v2/sql/` is constant (it is 
pydruid's default endpoint and is never entered by the user). A custom 
`DruidParametersSchema` therefore omits the `database` field, and 
`build_sqlalchemy_uri` injects the fixed path (`sqlalchemy_uri_database`).
   - **http/https toggle via the driver** — pydruid registers `druid` (and 
`druid+http`) for plain HTTP and `druid+https` for TLS (the 
`DruidHTTPSDialect`, `scheme="https"`). The `encryption` toggle switches the 
driver name accordingly rather than adding a query parameter, and 
`get_parameters_from_uri` recovers it from the driver name so the form 
round-trips.
   
   `username`/`password` are optional (anonymous Druid clusters are allowed); 
only `host` and `port` are required. The existing custom-certificate path 
(`get_extra_params` setting `connect_args.scheme=https`) is unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (backend engine-spec change; the frontend renders the dynamic form 
generically from `parameters_schema`).
   
   ### TESTING INSTRUCTIONS
   
   - `pytest tests/unit_tests/db_engine_specs/test_druid.py`
   - Manually: with `pydruid` installed, add a database → select **Apache 
Druid** → confirm the form now shows host/port/username/password/encryption 
fields (not the raw URI box), and that toggling **encryption** produces a 
`druid+https://…/druid/v2/sql/` URI.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] 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
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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