mistercrunch commented on a change in pull request #10645:
URL: 
https://github.com/apache/incubator-superset/pull/10645#discussion_r512344729



##########
File path: superset/views/datasource.py
##########
@@ -100,21 +100,11 @@ def external_metadata(
         self, datasource_type: str, datasource_id: int
     ) -> FlaskResponse:
         """Gets column info from the source system"""
-        if datasource_type == "druid":
+        try:
             datasource = ConnectorRegistry.get_datasource(
                 datasource_type, datasource_id, db.session
             )
-        elif datasource_type == "table":
-            database = (
-                
db.session.query(Database).filter_by(id=request.args.get("db_id")).one()
-            )
-            table_class = ConnectorRegistry.sources["table"]
-            datasource = table_class(
-                database=database,
-                table_name=request.args.get("table_name"),
-                schema=request.args.get("schema") or None,
-            )
-        else:
-            raise Exception(f"Unsupported datasource_type: {datasource_type}")

Review comment:
       NOTE: looked a bit deeper and it turns out that 
`/api/v1/database/1/table/` used for SQL Lab does much more, like getting 
index/comments and more. Eventually we could reuse that endpoint here and 
surface more of that metadata in this context as its somewhat relevant here 
too, but for now I think your approach is a better path forward.




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

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