Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: unify the signature of get_tag_values #74681

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sentry/plugins/bases/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TagPlugin(Plugin2):
tag: ClassVar[str]
project_default_enabled = True

def get_tag_values(self, event, **kwargs):
def get_tag_values(self, event) -> list[str]:
"""
Must return a list of values.

Expand Down
2 changes: 1 addition & 1 deletion src/sentry/plugins/sentry_interface_types/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class InterfaceTypePlugin(TagPlugin):
tag = "interface_type"
project_default_enabled = False

def get_tag_values(self, event):
def get_tag_values(self, event) -> list[str]:
return [i.rsplit(".", 1)[-1] for i in event.interfaces.keys()]
2 changes: 1 addition & 1 deletion src/sentry/plugins/sentry_urls/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class UrlsPlugin(TagPlugin):
tag = "url"
project_default_enabled = True

def get_tag_values(self, event):
def get_tag_values(self, event) -> list[str]:
http = event.interfaces.get("request")
if not http:
return []
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/plugins/sentry_useragents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class UserAgentPlugin(TagPlugin):
author_url = "https://github.com/getsentry/sentry"
project_default_enabled = True

def get_tag_values(self, event):
def get_tag_values(self, event) -> list[str]:
contexts = event.interfaces.get("contexts")
# disable tagging if contexts are present
if contexts:
Expand Down
Loading