File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
superset-frontend/src/SqlLab/actions Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -1409,17 +1409,18 @@ export function popQuery(queryId) {
14091409}
14101410export function popDatasourceQuery ( datasourceKey , sql ) {
14111411 return function ( dispatch ) {
1412+ const datasetId = datasourceKey . split ( '__' ) [ 0 ] ;
14121413 return SupersetClient . get ( {
1413- endpoint : `/superset/fetch_datasource_metadata?datasourceKey= ${ datasourceKey } ` ,
1414+ endpoint : `/api/v1/dataset/ ${ datasetId } ?q=(keys:!(none)) ` ,
14141415 } )
14151416 . then ( ( { json } ) =>
14161417 dispatch (
14171418 addQueryEditor ( {
1418- name : `Query ${ json . name } ` ,
1419- dbId : json . database . id ,
1420- schema : json . schema ,
1419+ name : `Query ${ json . result . name } ` ,
1420+ dbId : json . result . database . id ,
1421+ schema : json . result . schema ,
14211422 autorun : sql !== undefined ,
1422- sql : sql || json . select_star ,
1423+ sql : sql || json . result . select_star ,
14231424 } ) ,
14241425 ) ,
14251426 )
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ class DatasetRestApi(BaseSupersetModelRestApi):
142142 "cache_timeout" ,
143143 "is_sqllab_view" ,
144144 "template_params" ,
145+ "select_star" ,
145146 "owners.id" ,
146147 "owners.username" ,
147148 "owners.first_name" ,
Original file line number Diff line number Diff line change @@ -2598,6 +2598,11 @@ def fetch_datasource_metadata(self) -> FlaskResponse: # pylint: disable=no-self
25982598 :returns: The Flask response
25992599 :raises SupersetSecurityException: If the user cannot access the resource
26002600 """
2601+ logger .warning (
2602+ "%s.fetch_datasource_metadata "
2603+ "This API endpoint is deprecated and will be removed in version 3.0.0" ,
2604+ self .__class__ .__name__ ,
2605+ )
26012606
26022607 datasource_id , datasource_type = request .args ["datasourceKey" ].split ("__" )
26032608 datasource = DatasourceDAO .get_datasource (
You can’t perform that action at this time.
0 commit comments