mirror of
https://github.com/apache/superset.git
synced 2024-09-16 10:39:55 -04:00
chore: deprecate /superset/fetch_datasource_metadata mig to API v1 (#22102)
This commit is contained in:
parent
5b67e0712d
commit
7c6fabb033
@ -1409,17 +1409,18 @@ export function popQuery(queryId) {
|
||||
}
|
||||
export function popDatasourceQuery(datasourceKey, sql) {
|
||||
return function (dispatch) {
|
||||
const datasetId = datasourceKey.split('__')[0];
|
||||
return SupersetClient.get({
|
||||
endpoint: `/superset/fetch_datasource_metadata?datasourceKey=${datasourceKey}`,
|
||||
endpoint: `/api/v1/dataset/${datasetId}?q=(keys:!(none))`,
|
||||
})
|
||||
.then(({ json }) =>
|
||||
dispatch(
|
||||
addQueryEditor({
|
||||
name: `Query ${json.name}`,
|
||||
dbId: json.database.id,
|
||||
schema: json.schema,
|
||||
name: `Query ${json.result.name}`,
|
||||
dbId: json.result.database.id,
|
||||
schema: json.result.schema,
|
||||
autorun: sql !== undefined,
|
||||
sql: sql || json.select_star,
|
||||
sql: sql || json.result.select_star,
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
@ -142,6 +142,7 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
||||
"cache_timeout",
|
||||
"is_sqllab_view",
|
||||
"template_params",
|
||||
"select_star",
|
||||
"owners.id",
|
||||
"owners.username",
|
||||
"owners.first_name",
|
||||
|
@ -2598,6 +2598,11 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
|
||||
:returns: The Flask response
|
||||
:raises SupersetSecurityException: If the user cannot access the resource
|
||||
"""
|
||||
logger.warning(
|
||||
"%s.fetch_datasource_metadata "
|
||||
"This API endpoint is deprecated and will be removed in version 3.0.0",
|
||||
self.__class__.__name__,
|
||||
)
|
||||
|
||||
datasource_id, datasource_type = request.args["datasourceKey"].split("__")
|
||||
datasource = DatasourceDAO.get_datasource(
|
||||
|
Loading…
Reference in New Issue
Block a user