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 2023/03/29 20:49:58 UTC

[superset] branch test-tagging-2 created (now 5b0e15e325)

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

hugh pushed a change to branch test-tagging-2
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 5b0e15e325 enable tagging in the backend

This branch includes the following new commits:

     new 9e0b0e92b8 make tagging true
     new 5b0e15e325 enable tagging in the backend

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[superset] 02/02: enable tagging in the backend

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch test-tagging-2
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5b0e15e325a88a13381f5513e5ab0d222422504d
Author: hughhhh <hu...@gmail.com>
AuthorDate: Wed Mar 29 16:49:43 2023 -0400

    enable tagging in the backend
---
 superset/charts/api.py                | 12 ++++--------
 superset/dashboards/api.py            | 36 ++++++++++++-----------------------
 superset/models/slice.py              | 15 +++++++--------
 superset/models/sql_lab.py            | 15 +++++++--------
 superset/queries/saved_queries/api.py |  4 ++--
 5 files changed, 32 insertions(+), 50 deletions(-)

diff --git a/superset/charts/api.py b/superset/charts/api.py
index 5b453a2d99..2716337e85 100644
--- a/superset/charts/api.py
+++ b/superset/charts/api.py
@@ -141,8 +141,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
         "query_context",
         "is_managed_externally",
     ]
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        show_columns += ["tags.id", "tags.name", "tags.type"]
+    show_columns += ["tags.id", "tags.name", "tags.type"]
 
     show_select_columns = show_columns + ["table.id"]
     list_columns = [
@@ -186,8 +185,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
         "url",
         "viz_type",
     ]
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        list_columns += ["tags.id", "tags.name", "tags.type"]
+    list_columns += ["tags.id", "tags.name", "tags.type"]
     list_select_columns = list_columns + ["changed_by_fk", "changed_on"]
     order_columns = [
         "changed_by.first_name",
@@ -216,8 +214,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
         "slice_name",
         "viz_type",
     ]
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        search_columns += ["tags"]
+    search_columns += ["tags"]
     base_order = ("changed_on", "desc")
     base_filters = [["id", ChartFilter, lambda: []]]
     search_filters = {
@@ -225,8 +222,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
         "slice_name": [ChartAllTextFilter],
         "created_by": [ChartHasCreatedByFilter, ChartCreatedByMeFilter],
     }
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        search_filters["tags"] = [ChartTagFilter]
+    search_filters["tags"] = [ChartTagFilter]
 
     # Will just affect _info endpoint
     edit_columns = ["slice_name"]
diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py
index 580fc8bc8a..3cee225107 100644
--- a/superset/dashboards/api.py
+++ b/superset/dashboards/api.py
@@ -215,36 +215,24 @@ class DashboardRestApi(BaseSupersetModelRestApi):
     edit_columns = add_columns
 
     search_columns = (
-        (
-            "created_by",
-            "changed_by",
-            "dashboard_title",
-            "id",
-            "owners",
-            "published",
-            "roles",
-            "slug",
-            "tags",
-        )
-        if is_feature_enabled("TAGGING_SYSTEM")
-        else (
-            "created_by",
-            "changed_by",
-            "dashboard_title",
-            "id",
-            "owners",
-            "published",
-            "roles",
-            "slug",
-        )
+        "created_by",
+        "changed_by",
+        "dashboard_title",
+        "id",
+        "owners",
+        "published",
+        "roles",
+        "slug",
+        "tags",
     )
+
     search_filters = {
         "dashboard_title": [DashboardTitleOrSlugFilter],
         "id": [DashboardFavoriteFilter, DashboardCertifiedFilter],
         "created_by": [DashboardCreatedByMeFilter, DashboardHasCreatedByFilter],
     }
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        search_filters["tags"] = [DashboardTagFilter]
+    
+    search_filters["tags"] = [DashboardTagFilter]
 
     base_order = ("changed_on", "desc")
 
diff --git a/superset/models/slice.py b/superset/models/slice.py
index 9ab4039a93..1b15d5e33e 100644
--- a/superset/models/slice.py
+++ b/superset/models/slice.py
@@ -96,14 +96,13 @@ class Slice(  # pylint: disable=too-many-public-methods
         security_manager.user_model, foreign_keys=[last_saved_by_fk]
     )
     owners = relationship(security_manager.user_model, secondary=slice_user)
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        tags = relationship(
-            "Tag",
-            secondary="tagged_object",
-            primaryjoin="and_(Slice.id == TaggedObject.object_id)",
-            secondaryjoin="and_(TaggedObject.tag_id == Tag.id, "
-            "TaggedObject.object_type == 'chart')",
-        )
+    tags = relationship(
+        "Tag",
+        secondary="tagged_object",
+        primaryjoin="and_(Slice.id == TaggedObject.object_id)",
+        secondaryjoin="and_(TaggedObject.tag_id == Tag.id, "
+        "TaggedObject.object_type == 'chart')",
+    )
     table = relationship(
         "SqlaTable",
         foreign_keys=[datasource_id],
diff --git a/superset/models/sql_lab.py b/superset/models/sql_lab.py
index f12c8d6c45..55649c2e54 100644
--- a/superset/models/sql_lab.py
+++ b/superset/models/sql_lab.py
@@ -366,14 +366,13 @@ class SavedQuery(Model, AuditMixinNullable, ExtraJSONMixin, ImportExportMixin):
     )
     rows = Column(Integer, nullable=True)
     last_run = Column(DateTime, nullable=True)
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        tags = relationship(
-            "Tag",
-            secondary="tagged_object",
-            primaryjoin="and_(SavedQuery.id == TaggedObject.object_id)",
-            secondaryjoin="and_(TaggedObject.tag_id == Tag.id, "
-            "TaggedObject.object_type == 'saved_query')",
-        )
+    tags = relationship(
+        "Tag",
+        secondary="tagged_object",
+        primaryjoin="and_(SavedQuery.id == TaggedObject.object_id)",
+        secondaryjoin="and_(TaggedObject.tag_id == Tag.id, "
+        "TaggedObject.object_type == 'saved_query')",
+    )
 
     export_parent = "database"
     export_fields = [
diff --git a/superset/queries/saved_queries/api.py b/superset/queries/saved_queries/api.py
index 0996ab9b3f..707a264e42 100644
--- a/superset/queries/saved_queries/api.py
+++ b/superset/queries/saved_queries/api.py
@@ -151,8 +151,8 @@ class SavedQueryRestApi(BaseSupersetModelRestApi):
         "id": [SavedQueryFavoriteFilter],
         "label": [SavedQueryAllTextFilter],
     }
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        search_filters["tags"] = [SavedQueryTagFilter]
+
+    search_filters["tags"] = [SavedQueryTagFilter]
 
     apispec_parameter_schemas = {
         "get_delete_ids_schema": get_delete_ids_schema,


[superset] 01/02: make tagging true

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch test-tagging-2
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 9e0b0e92b871d28c7dbd142d6f8c700ed4aafdf3
Author: hughhhh <hu...@gmail.com>
AuthorDate: Wed Mar 29 15:29:32 2023 -0400

    make tagging true
---
 superset/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset/config.py b/superset/config.py
index c9234e521d..dcca1f46c5 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -425,7 +425,7 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
     "DASHBOARD_CACHE": False,
     "REMOVE_SLICE_LEVEL_LABEL_COLORS": False,
     "SHARE_QUERIES_VIA_KV_STORE": False,
-    "TAGGING_SYSTEM": False,
+    "TAGGING_SYSTEM": True,
     "SQLLAB_BACKEND_PERSISTENCE": True,
     "LISTVIEWS_DEFAULT_CARD_VIEW": False,
     # When True, this flag allows display of HTML tags in Markdown components