hughhhh commented on code in PR #24839:
URL: https://github.com/apache/superset/pull/24839#discussion_r1300219889
##########
superset/daos/tag.py:
##########
@@ -363,3 +364,46 @@ def favorited_ids(tags: list[Tag]) -> list[int]:
)
.all()
]
+
+ @staticmethod
+ def create_tag_relationship(
+ objects_to_tag: list[tuple[ObjectTypes, int]], tag: Tag
+ ) -> None:
+ """
+ Creates a tag relationship between the given objects and the specified
tag.
+ This function iterates over a list of objects, each specified by a type
+ and an id, and creates a TaggedObject for each one, associating it with
+ the provided tag. All created TaggedObjects are collected in a list.
+ Args:
+ objects_to_tag (List[Tuple[ObjectTypes, int]]): A list of tuples,
each
+ containing an ObjectType and an id, representing the objects to be
tagged.
+
+ tag (Tag): The tag to be associated with the specified objects.
+ Returns:
+ None.
+ """
+ tagged_objects = []
+ if not tag:
+ raise TagNotFoundError()
Review Comment:
it's already defined in the API layer:
```
except TagNotFoundError:
return self.response_404()
```
--
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]