sadpandajoe commented on code in PR #35542:
URL: https://github.com/apache/superset/pull/35542#discussion_r3960030748
##########
superset/tags/models.py:
##########
@@ -104,6 +104,8 @@ class Tag(CoreTag, AuditMixinNullable):
security_manager.user_model, secondary=user_favorite_tag_table
)
+ __table_args__ = (UniqueConstraint("name", "type",
name="uix_tag_name_type"),)
Review Comment:
This has a destructive path in the current code:
`DeleteTagsCommand.validate()` accepts a name when `find_by_name()` returns any
matching row, while `delete_tags()` then deletes every row with that name. Once
a custom tag shares a system-tag name, an otherwise valid delete request can
remove both variants and their associations. Could these operations take a tag
ID or `(name, type)` so validation and deletion select the same row?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]