Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improving handling for tag relationship when deleting assets v2 (#…
Browse files Browse the repository at this point in the history
Vitor-Avila authored and eschutho committed Jul 24, 2024
1 parent 9e191a2 commit a1f2d49
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions superset/models/dashboard.py
Original file line number Diff line number Diff line change
@@ -154,8 +154,8 @@ class Dashboard(AuditMixinNullable, ImportExportMixin, Model):
secondary="tagged_object",
primaryjoin="and_(Dashboard.id == TaggedObject.object_id, "
"TaggedObject.object_type == 'dashboard')",
secondaryjoin="and_(TaggedObject.tag_id == Tag.id)",
passive_deletes=True,
secondaryjoin="TaggedObject.tag_id == Tag.id",
viewonly=True, # cascading deletion already handled by superset.tags.models.ObjectUpdater.after_delete
)
published = Column(Boolean, default=False)
is_managed_externally = Column(Boolean, nullable=False, default=False)
4 changes: 2 additions & 2 deletions superset/models/slice.py
Original file line number Diff line number Diff line change
@@ -106,8 +106,8 @@ class Slice( # pylint: disable=too-many-public-methods
overlaps="objects,tag,tags",
primaryjoin="and_(Slice.id == TaggedObject.object_id, "
"TaggedObject.object_type == 'chart')",
secondaryjoin="and_(TaggedObject.tag_id == Tag.id)",
passive_deletes=True,
secondaryjoin="TaggedObject.tag_id == Tag.id",
viewonly=True, # cascading deletion already handled by superset.tags.models.ObjectUpdater.after_delete
)
table = relationship(
"SqlaTable",
4 changes: 2 additions & 2 deletions superset/models/sql_lab.py
Original file line number Diff line number Diff line change
@@ -418,8 +418,8 @@ class SavedQuery(
overlaps="objects,tag,tags",
primaryjoin="and_(SavedQuery.id == TaggedObject.object_id, "
"TaggedObject.object_type == 'query')",
secondaryjoin="and_(TaggedObject.tag_id == Tag.id)",
passive_deletes=True,
secondaryjoin="TaggedObject.tag_id == Tag.id",
viewonly=True, # cascading deletion already handled by superset.tags.models.ObjectUpdater.after_delete
)

export_parent = "database"

0 comments on commit a1f2d49

Please sign in to comment.