diff --git a/src/sentry/search/events/builder/discover.py b/src/sentry/search/events/builder/discover.py index 06856a3385feae..e1b94f227b6dea 100644 --- a/src/sentry/search/events/builder/discover.py +++ b/src/sentry/search/events/builder/discover.py @@ -1380,7 +1380,7 @@ def get_public_alias(self, function: CurriedFunction) -> str: ie. any_user_display -> any(user_display) """ - return self.function_alias_map[function.alias].field + return self.function_alias_map.get(function.alias, function.alias).field def get_snql_query(self) -> Request: self.validate_having_clause()