add columns for bootstrap_data (#20134)

This commit is contained in:
Hugh A. Miles II 2022-05-26 11:26:11 -04:00 committed by GitHub
parent 77ccec50cc
commit 7a2eb8b602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -889,8 +889,11 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
except (SupersetException, SQLAlchemyError):
datasource_data = dummy_datasource_data
columns: List[Dict[str, Any]] = []
if datasource:
datasource_data["owners"] = datasource.owners_data
if isinstance(datasource, Query):
columns = datasource.extra.get("columns", [])
bootstrap_data = {
"can_add": slice_add_perm,
@ -905,6 +908,7 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
"user": bootstrap_user_data(g.user, include_perms=True),
"forced_height": request.args.get("height"),
"common": common_bootstrap_payload(),
"columns": columns,
}
if slc:
title = slc.slice_name