feat: add denylist for db engines
SUMMARY
Some db_engine_specs can have multiple db_engine_specs, Databricks for example. Since we build the database connection form available dbs dropdown list based on db_engine_specs that match installed drivers, there are times when one may not want to show all options. This is a simple optional denylist config that removes extra db engines from that list.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
With this code and no extra config added (this is what it looks like without this code): Additional drivers installed: databricks-sql-connector 2.0.2 sqlalchemy-databricks 0.2.0

With added local superset_config of:
DBS_AVAILABLE_DENYLIST: Dict[str, Tuple[str, ...]] = {
"databricks": ("pyhive", "pyodbc")}

TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Codecov Report
Merging #21486 (09afa27) into master (aef6217) will increase coverage by
9.81%. The diff coverage is83.33%.
:exclamation: Current head 09afa27 differs from pull request most recent head 2b9c704. Consider uploading reports for the commit 2b9c704 to get more accurate results
@@ Coverage Diff @@
## master #21486 +/- ##
==========================================
+ Coverage 55.46% 65.28% +9.81%
==========================================
Files 1800 1792 -8
Lines 68940 68671 -269
Branches 7334 7320 -14
==========================================
+ Hits 38236 44830 +6594
+ Misses 28812 21951 -6861
+ Partials 1892 1890 -2
| Flag | Coverage Δ | |
|---|---|---|
| hive | 52.91% <83.33%> (-0.01%) |
:arrow_down: |
| mysql | 78.21% <83.33%> (?) |
|
| postgres | 78.28% <83.33%> (?) |
|
| presto | ? |
|
| python | 78.62% <83.33%> (+20.70%) |
:arrow_up: |
| sqlite | 76.78% <83.33%> (?) |
|
| unit | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| superset/db_engine_specs/__init__.py | 84.52% <80.00%> (+0.97%) |
:arrow_up: |
| superset/config.py | 91.61% <100.00%> (+0.64%) |
:arrow_up: |
| superset/tables/schemas.py | 0.00% <0.00%> (-100.00%) |
:arrow_down: |
| superset/columns/schemas.py | 0.00% <0.00%> (-100.00%) |
:arrow_down: |
| ...-chart-table/src/DataTable/utils/useMountedMemo.ts | 0.00% <0.00%> (-87.50%) |
:arrow_down: |
| ...set/advanced_data_type/plugins/internet_address.py | 16.32% <0.00%> (-79.60%) |
:arrow_down: |
| superset/utils/pandas_postprocessing/boxplot.py | 20.51% <0.00%> (-79.49%) |
:arrow_down: |
| superset/charts/post_processing.py | 11.76% <0.00%> (-77.95%) |
:arrow_down: |
| ...perset/advanced_data_type/plugins/internet_port.py | 18.75% <0.00%> (-77.09%) |
:arrow_down: |
| superset/utils/pandas_postprocessing/rolling.py | 21.87% <0.00%> (-68.75%) |
:arrow_down: |
| ... and 474 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more