Skip to content
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
4 changes: 3 additions & 1 deletion src/sentry/workflow_engine/processors/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def process_data_sources(
# Fetch all data sources and associated detectors for the given data packets
with sentry_sdk.start_span(op="workflow_engine.process_data_sources.fetch_data_sources"):
data_sources = DataSource.objects.filter(
source_id__in=data_packet_ids, type=query_type
source_id__in=data_packet_ids,
type=query_type,
detectors__enabled=True,
).prefetch_related(Prefetch("detectors"))

# Build a lookup dict for source_id to detectors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ def test_multiple_data_packets(self):
(self.packet_two, [self.detector_two]),
]

def test_disabled_detector(self):
self.detector_one.enabled = False
self.detector_one.save()

assert process_data_sources(self.data_packets, "test") == [
(self.packet_two, [self.detector_two])
]

def test_multiple_detectors(self):
self.detector_three = self.create_detector(name="test_detector3")
self.detector_four = self.create_detector(name="test_detector4")
Expand Down
Loading