mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat!: pass datasource_type and datasource_id to form_data (#19981)
* pass datasource_type and datasource_id to form_data * add datasource_type to delete command * add datasource_type to delete command * fix old keys implementation * add more tests
This commit is contained in:
committed by
GitHub
parent
a813528958
commit
32bb1ce3ff
@@ -39,20 +39,24 @@ class CreateFormDataCommand(BaseCommand):
|
||||
def run(self) -> str:
|
||||
self.validate()
|
||||
try:
|
||||
dataset_id = self._cmd_params.dataset_id
|
||||
datasource_id = self._cmd_params.datasource_id
|
||||
datasource_type = self._cmd_params.datasource_type
|
||||
chart_id = self._cmd_params.chart_id
|
||||
tab_id = self._cmd_params.tab_id
|
||||
actor = self._cmd_params.actor
|
||||
form_data = self._cmd_params.form_data
|
||||
check_access(dataset_id, chart_id, actor)
|
||||
contextual_key = cache_key(session.get("_id"), tab_id, dataset_id, chart_id)
|
||||
check_access(datasource_id, chart_id, actor, datasource_type)
|
||||
contextual_key = cache_key(
|
||||
session.get("_id"), tab_id, datasource_id, chart_id, datasource_type
|
||||
)
|
||||
key = cache_manager.explore_form_data_cache.get(contextual_key)
|
||||
if not key or not tab_id:
|
||||
key = random_key()
|
||||
if form_data:
|
||||
state: TemporaryExploreState = {
|
||||
"owner": get_owner(actor),
|
||||
"dataset_id": dataset_id,
|
||||
"datasource_id": datasource_id,
|
||||
"datasource_type": datasource_type,
|
||||
"chart_id": chart_id,
|
||||
"form_data": form_data,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user