You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/20 03:19:03 UTC

(superset) branch master updated: refactor: do not cascade to TaggedObject (#42223)

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

rusackas 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 36dbff091f4 refactor: do not cascade to TaggedObject (#42223)
36dbff091f4 is described below

commit 36dbff091f4280db544b8dafd92146408cb43405
Author: Hans Yu <ha...@outlook.de>
AuthorDate: Mon Jul 20 05:18:53 2026 +0200

    refactor: do not cascade to TaggedObject (#42223)
---
 pytest.ini              |  2 +-
 superset/tags/models.py | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/pytest.ini b/pytest.ini
index 1a4054f036b..1120030f567 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -34,7 +34,7 @@ filterwarnings =
 #    error:"SqlaTable" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
 #    error:"SqlMetric" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
 #    error:"TableColumn" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
-#    error:"TaggedObject" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
+    error:"TaggedObject" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
     error:The autoload parameter is deprecated:sqlalchemy.exc.RemovedIn20Warning
     error:The current statement is being autocommitted using implicit autocommit:sqlalchemy.exc.RemovedIn20Warning
     error:The connection.execute\(\) method:sqlalchemy.exc.RemovedIn20Warning
diff --git a/superset/tags/models.py b/superset/tags/models.py
index a80bd6dd49b..c60e660b23d 100644
--- a/superset/tags/models.py
+++ b/superset/tags/models.py
@@ -98,7 +98,10 @@ class Tag(CoreTag, AuditMixinNullable):
     description = Column(Text)
 
     objects = relationship(
-        "TaggedObject", back_populates="tag", overlaps="objects,tags"
+        "TaggedObject",
+        back_populates="tag",
+        cascade_backrefs=False,
+        overlaps="objects,tags",
     )
 
     users_favorited = relationship(
@@ -122,7 +125,12 @@ class TaggedObject(Model, AuditMixinNullable):
     object_id = Column(Integer)
     object_type = Column(Enum(ObjectType))
 
-    tag = relationship("Tag", back_populates="objects", overlaps="tags")
+    tag = relationship(
+        "Tag",
+        back_populates="objects",
+        cascade_backrefs=False,
+        overlaps="tags",
+    )
     __table_args__ = (
         UniqueConstraint(
             "tag_id", "object_id", "object_type", name="uix_tagged_object"