mistercrunch commented on a change in pull request #10645:
URL:
https://github.com/apache/incubator-superset/pull/10645#discussion_r512313955
##########
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:
Mmmmh, oh it could b that we use this for tables that don't have
associated datasets yet, for example in the SQL Lab code base where we show the
schema of a table on the left panel.
----------------------------------------------------------------
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]