Skip to content

Commit

Permalink
bring fix from another branch
Browse files Browse the repository at this point in the history
  • Loading branch information
saponifi3d committed Dec 13, 2024
1 parent ee1fbf6 commit 6e30368
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sentry/workflow_engine/processors/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def process_data_sources(
) -> list[tuple[DataPacket, list[Detector]]]:
metrics.incr("sentry.workflow_engine.process_data_sources", tags={"query_type": query_type})

data_packet_ids = {packet.query_id for packet in data_packets}
data_packet_ids = {int(packet.query_id) for packet in data_packets}

# Fetch all data sources and associated detectors for the given data packets
with sentry_sdk.start_span(op="sentry.workflow_engine.process_data_sources.fetch_data_sources"):
Expand All @@ -23,12 +23,12 @@ def process_data_sources(
).prefetch_related(Prefetch("detectors"))

# Build a lookup dict for query_id to detectors
query_id_to_detectors = {ds.query_id: list(ds.detectors.all()) for ds in data_sources}
query_id_to_detectors = {int(ds.query_id): list(ds.detectors.all()) for ds in data_sources}

# Create the result tuples
result = []
for packet in data_packets:
detectors = query_id_to_detectors.get(packet.query_id)
detectors = query_id_to_detectors.get(int(packet.query_id))

if detectors:
data_packet_tuple = (packet, detectors)
Expand Down

0 comments on commit 6e30368

Please sign in to comment.