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/31 21:14:34 UTC

[superset] 01/01: remove feature flag on model defintion

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

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

commit ce86e88f037082fd3fc0dab64d524911bdef2a3a
Author: hughhhh <hu...@gmail.com>
AuthorDate: Fri Mar 31 17:14:07 2023 -0400

    remove feature flag on model defintion
---
 superset/models/dashboard.py | 15 +++++++--------
 superset/models/slice.py     | 15 +++++++--------
 superset/models/sql_lab.py   | 15 +++++++--------
 3 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/superset/models/dashboard.py b/superset/models/dashboard.py
index d6dfe79d7f..9292e1acd1 100644
--- a/superset/models/dashboard.py
+++ b/superset/models/dashboard.py
@@ -149,14 +149,13 @@ class Dashboard(Model, AuditMixinNullable, ImportExportMixin):
         Slice, secondary=dashboard_slices, backref="dashboards"
     )
     owners = relationship(security_manager.user_model, secondary=dashboard_user)
-    if is_feature_enabled("TAGGING_SYSTEM"):
-        tags = relationship(
-            "Tag",
-            secondary="tagged_object",
-            primaryjoin="and_(Dashboard.id == TaggedObject.object_id)",
-            secondaryjoin="and_(TaggedObject.tag_id == Tag.id, "
-            "TaggedObject.object_type == 'dashboard')",
-        )
+    tags = relationship(
+        "Tag",
+        secondary="tagged_object",
+        primaryjoin="and_(Dashboard.id == TaggedObject.object_id)",
+        secondaryjoin="and_(TaggedObject.tag_id == Tag.id, "
+        "TaggedObject.object_type == 'dashboard')",
+    )
     published = Column(Boolean, default=False)
     is_managed_externally = Column(Boolean, nullable=False, default=False)
     external_url = Column(Text, nullable=True)
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 = [