diff --git a/src/sentry/plugins/base/v2.py b/src/sentry/plugins/base/v2.py index 062e4b13b2e6fe..166d76f3c37aac 100644 --- a/src/sentry/plugins/base/v2.py +++ b/src/sentry/plugins/base/v2.py @@ -331,7 +331,7 @@ def get_actions(self, request, group) -> list[tuple[str, str]]: """ return [] - def get_annotations(self, group, **kwargs): + def get_annotations(self, group) -> list[dict[str, str]]: """ Return a list of annotations to append to this aggregate. @@ -340,7 +340,7 @@ def get_annotations(self, group, **kwargs): The properties of each tag must match the constructor for :class:`sentry.plugins.Annotation` - >>> def get_annotations(self, group, **kwargs): + >>> def get_annotations(self, group): >>> task_id = GroupMeta.objects.get_value(group, 'myplugin:tid') >>> if not task_id: >>> return [] diff --git a/src/sentry/templatetags/sentry_plugins.py b/src/sentry/templatetags/sentry_plugins.py index da9586249347d4..1936199fcc9ba9 100644 --- a/src/sentry/templatetags/sentry_plugins.py +++ b/src/sentry/templatetags/sentry_plugins.py @@ -28,7 +28,7 @@ def get_actions(group, request): @register.filter -def get_annotations(group, request=None): +def get_annotations(group, request=None) -> list[dict[str, str]]: project = group.project annotation_list = [] diff --git a/tests/sentry/templatetags/test_sentry_plugins.py b/tests/sentry/templatetags/test_sentry_plugins.py index b643074b0ba084..88949e66d69e40 100644 --- a/tests/sentry/templatetags/test_sentry_plugins.py +++ b/tests/sentry/templatetags/test_sentry_plugins.py @@ -10,7 +10,7 @@ class SamplePlugin(Plugin2): def get_actions(self, request, group) -> list[tuple[str, str]]: return [("Example Action", f"http://example.com?id={group.id}")] - def get_annotations(self, group): + def get_annotations(self, group) -> list[dict[str, str]]: return [ {"label": "Example Tag", "url": f"http://example.com?id={group.id}"}, {"label": "Example Two"},