Vitor-Avila commented on code in PR #35541:
URL: https://github.com/apache/superset/pull/35541#discussion_r2409179046
##########
superset/commands/utils.py:
##########
@@ -183,9 +183,12 @@ def update_tags(
]
if tag_ids_to_add:
tags_to_add = TagDAO.find_by_ids(tag_ids_to_add)
- TagDAO.create_custom_tagged_objects(
- object_type, object_id, [tag.name for tag in tags_to_add]
- )
+ # Only add custom tags - system tags are managed automatically
+ custom_tags_to_add = [tag for tag in tags_to_add if tag.type ==
TagType.custom]
+ if custom_tags_to_add:
+ TagDAO.create_custom_tagged_objects(
+ object_type, object_id, [tag.name for tag in
custom_tags_to_add]
+ )
Review Comment:
Considering that system tags are actually managed by SQLAlchemy event
listeners, I'm thinking that maybe we could validate if the payload includes
any system tag, and raise if so? Just to avoid silently removing them from the
payload. We could probably do so in
[validate_tags](https://github.com/apache/superset/blob/fc41d7ea2c73f21919b216ee61269c300e7f762c/superset/commands/utils.py#L113-L154).
What do you think?
--
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]