Skip to content

Commit 1491155

Browse files
ref: don't use CanonicalKeyView for interfaces (#71099)
these are already canonicalized names <!-- Describe your PR here. -->
1 parent ee461ce commit 1491155

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/sentry/eventstore/models.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from sentry.models.event import EventDict
2727
from sentry.snuba.events import Columns
2828
from sentry.spans.grouping.api import load_span_grouping_config
29-
from sentry.utils.canonical import CanonicalKeyView
3029
from sentry.utils.safe import get_path, trim
3130
from sentry.utils.strings import truncatechars
3231

@@ -70,9 +69,7 @@ def __init__(
7069
def __getstate__(self) -> Mapping[str, Any]:
7170
state = self.__dict__.copy()
7271
# do not pickle cached info. We want to fetch this on demand
73-
# again. In particular if we were to pickle interfaces we would
74-
# pickle a CanonicalKeyView which old sentry workers do not know
75-
# about
72+
# again.
7673
state.pop("_project_cache", None)
7774
state.pop("_environment_cache", None)
7875
state.pop("_group_cache", None)
@@ -304,12 +301,9 @@ def project(self, project: Project) -> None:
304301
self.project_id = project.id
305302
self._project_cache = project
306303

307-
def get_interfaces(self) -> Mapping[str, Interface]:
308-
return CanonicalKeyView(get_interfaces(self.data))
309-
310304
@cached_property
311305
def interfaces(self) -> Mapping[str, Interface]:
312-
return self.get_interfaces()
306+
return get_interfaces(self.data)
313307

314308
def get_interface(self, name: str) -> Interface | None:
315309
return self.interfaces.get(name)

0 commit comments

Comments
 (0)