mistercrunch commented on code in PR #26654:
URL: https://github.com/apache/superset/pull/26654#discussion_r1458113350


##########
superset/daos/tag.py:
##########
@@ -51,14 +51,29 @@ def create_custom_tagged_objects(
         object_type: ObjectType, object_id: int, tag_names: list[str]
     ) -> None:
         tagged_objects = []
-        for name in tag_names:
+
+        # striping and de-dupping
+        clean_tag_names: set[str] = {tag.strip() for tag in tag_names}
+
+        for name in clean_tag_names:
             type_ = TagType.custom
-            tag_name = name.strip()

Review Comment:
   This could have led to dups, if you add "hello" and "hello  " it would 
probably trigger an error. Wasn't the root cause but might as well clean it up. 



-- 
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]

Reply via email to