|
@@ -5,6 +5,7 @@ import sentry_sdk
|
|
|
from django.db import transaction
|
|
|
from rest_framework.request import Request
|
|
|
from rest_framework.response import Response
|
|
|
+from snuba_sdk import Request as SnubaRequest
|
|
|
from snuba_sdk.conditions import Condition, Op
|
|
|
from snuba_sdk.orderby import Direction, OrderBy
|
|
|
from snuba_sdk.query import Column, Entity, Function, Query
|
|
@@ -158,10 +159,14 @@ def _get_full_hierarchical_hashes(group: Group, hash: str) -> Optional[Sequence[
|
|
|
]
|
|
|
)
|
|
|
)
|
|
|
- request = Request(dataset="events", app_id="grouping", query=query)
|
|
|
- data = snuba.raw_snql_query(request, referrer="group_split.get_full_hierarchical_hashes")[
|
|
|
- "data"
|
|
|
- ]
|
|
|
+ referrer = "group_split.get_full_hierarchical_hashes"
|
|
|
+ request = SnubaRequest(
|
|
|
+ dataset="events",
|
|
|
+ app_id="grouping",
|
|
|
+ query=query,
|
|
|
+ tenant_ids={"referrer": referrer, "organization_id": group.project.organization_id},
|
|
|
+ )
|
|
|
+ data = snuba.raw_snql_query(request, referrer)["data"]
|
|
|
if not data:
|
|
|
return None
|
|
|
|
|
@@ -385,10 +390,17 @@ def _render_trees(group: Group, user):
|
|
|
)
|
|
|
|
|
|
rv = []
|
|
|
- request = Request(dataset="events", app_id="grouping", query=query)
|
|
|
- for row in snuba.raw_snql_query(request, referrer="api.group_split.render_grouping_tree")[
|
|
|
- "data"
|
|
|
- ]:
|
|
|
+ referrer = "api.group_split.render_grouping_tree"
|
|
|
+ request = SnubaRequest(
|
|
|
+ dataset="events",
|
|
|
+ app_id="grouping",
|
|
|
+ query=query,
|
|
|
+ tenant_ids={
|
|
|
+ "referrer": referrer,
|
|
|
+ "organization_id": group.project.organization_id,
|
|
|
+ },
|
|
|
+ )
|
|
|
+ for row in snuba.raw_snql_query(request, referrer)["data"]:
|
|
|
if len(row["hash_slice"]) == 0:
|
|
|
hash = row["primary_hash"]
|
|
|
parent_hash = child_hash = None
|