villebro commented on a change in pull request #10645:
URL:
https://github.com/apache/incubator-superset/pull/10645#discussion_r474550635
##########
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:
I don't know why the table was created like this instead of just using
the available functionality that populates all fields like `sql`.
----------------------------------------------------------------
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]