betodealmeida opened a new pull request, #28376: URL: https://github.com/apache/superset/pull/28376
<!--- 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 PR finishes the initial work for https://github.com/apache/superset/issues/22862, introducing a new hierarchical data level: catalogs. A few important concepts: - Not all databases support catalogs. Notable databases that do support catalogs are Presto, Trino, Snowflake, Databricks, BigQuery ("projects"), and Postgres ("databases"). - SQLAlchemy has no concept of catalogs, only schemas. Because of this, DB engine specs need to implement methods that (1) return the default catalog, (2) return the list of catalog names available, and (3) modify the SQLAlchemy URI before a connection so it can point to a non-default catalog when necessary. So far only this has only been implemented in Postgres, and I'm planning to add support for Databricks next. - Support for changing the catalog needs to be enabled for each database, and defaults to false.  Once the feature is enabled, a dropdown will show up the in `DatabaseSelector` component, allowing users to select a catalog. This includes SQL Lab, the page for adding datasets, and the dataset editor.  The dropdown is hidden when a database without the feature is selected: https://github.com/apache/superset/assets/1534870/d00de9e1-b2ac-423c-8936-6d2253ba5c95 Nothing should change for databases that don't support catalogs, or that have it disabled. Relevant APIs have been updated to accept an optional `catalog`. Databases without support will simply ignore it, and databases that support it will use it to establish the connection, or fallback to the default catalog is a `null` is passed. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> See above. ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> WIP, I'm currently updating existing tests and adding new tests. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [X] Has associated issue: https://github.com/apache/superset/issues/22862 - [ ] Required feature flags: - [X] 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org