You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/11 19:48:23 UTC

[GitHub] [superset] betodealmeida opened a new pull request, #20674: fix: Databricks views showing up as tables

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

   <!---
   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 -->
   
   The Databricks connector returns views as tables, so that they show up twice in SQL Lab:
   
   <img width="416" alt="Screen Shot 2022-07-11 at 11 56 19 AM" src="https://user-images.githubusercontent.com/1534870/178346107-20c0cd79-2020-4d36-a9bd-2613d35b6cf4.png">
   
   This PR fixes it by removing the views from the tables:
   
   <img width="418" alt="Screen Shot 2022-07-11 at 11 54 48 AM" src="https://user-images.githubusercontent.com/1534870/178346150-f3a5a026-b221-4bf2-91a3-67121209eeec.png">
   
   This is the same approach we do for Presto/Trino, BTW.
   
   ### 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? -->
   
   ### 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
   - [ ] 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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] betodealmeida merged pull request #20674: fix: Databricks views showing up as tables

Posted by GitBox <gi...@apache.org>.
betodealmeida merged PR #20674:
URL: https://github.com/apache/superset/pull/20674


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a diff in pull request #20674: fix: Databricks views showing up as tables

Posted by GitBox <gi...@apache.org>.
hughhhh commented on code in PR #20674:
URL: https://github.com/apache/superset/pull/20674#discussion_r925057977


##########
superset/db_engine_specs/databricks.py:
##########
@@ -71,3 +76,16 @@ class DatabricksNativeEngineSpec(DatabricksODBCEngineSpec):
     engine = "databricks"
     engine_name = "Databricks Native Connector"
     driver = "connector"
+
+    @classmethod
+    def get_table_names(
+        cls,
+        database: "Database",
+        inspector: Inspector,
+        schema: Optional[str],
+    ) -> List[str]:
+        tables = super().get_table_names(database, inspector, schema)
+        views = set(cls.get_view_names(database, inspector, schema))
+        actual_tables = set(tables) - views

Review Comment:
   nit: `actual_tables = set(tables) - set(views)` for consistency



-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a diff in pull request #20674: fix: Databricks views showing up as tables

Posted by GitBox <gi...@apache.org>.
hughhhh commented on code in PR #20674:
URL: https://github.com/apache/superset/pull/20674#discussion_r925057977


##########
superset/db_engine_specs/databricks.py:
##########
@@ -71,3 +76,16 @@ class DatabricksNativeEngineSpec(DatabricksODBCEngineSpec):
     engine = "databricks"
     engine_name = "Databricks Native Connector"
     driver = "connector"
+
+    @classmethod
+    def get_table_names(
+        cls,
+        database: "Database",
+        inspector: Inspector,
+        schema: Optional[str],
+    ) -> List[str]:
+        tables = super().get_table_names(database, inspector, schema)
+        views = set(cls.get_view_names(database, inspector, schema))
+        actual_tables = set(tables) - views

Review Comment:
   nit: `return list(set(tables) - set(views))` for consistency



-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org