You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2022/05/26 15:26:17 UTC

[superset] branch master updated: add columns for bootstrap_data (#20134)

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a2eb8b602 add columns for bootstrap_data (#20134)
7a2eb8b602 is described below

commit 7a2eb8b602bf1701aa5641f23577d45adef4e37d
Author: Hugh A. Miles II <hu...@gmail.com>
AuthorDate: Thu May 26 11:26:11 2022 -0400

    add columns for bootstrap_data (#20134)
---
 superset/views/core.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/superset/views/core.py b/superset/views/core.py
index 15ff3b1620..12b04dd706 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -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