Skip to content

Commit f9e6717

Browse files
ref(py): Update monitor_consumer to handle FilteredPayload (#69904)
This is primarily a typing adjustment. Since we're not using `FilterStep` we're never going to actually get a `FilteredPayload`.
1 parent 2c13e60 commit f9e6717

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sentry/monitors/consumers/monitor_consumer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from arroyo.processing.strategies.batching import BatchStep, ValuesBatch
1616
from arroyo.processing.strategies.commit import CommitOffsets
1717
from arroyo.processing.strategies.run_task import RunTask
18-
from arroyo.types import BrokerValue, Commit, Message, Partition
18+
from arroyo.types import BrokerValue, Commit, FilteredPayload, Message, Partition
1919
from django.db import router, transaction
2020
from sentry_kafka_schemas import get_codec
2121
from sentry_kafka_schemas.schema_types.ingest_monitors_v1 import IngestMonitorMessage
@@ -904,8 +904,10 @@ def process_batch(executor: ThreadPoolExecutor, message: Message[ValuesBatch[Kaf
904904
logger.exception("Failed to trigger monitor tasks")
905905

906906

907-
def process_single(message: Message[KafkaPayload]):
907+
def process_single(message: Message[KafkaPayload | FilteredPayload]):
908+
assert not isinstance(message.payload, FilteredPayload)
908909
assert isinstance(message.value, BrokerValue)
910+
909911
try:
910912
wrapper: IngestMonitorMessage = MONITOR_CODEC.decode(message.payload.value)
911913
ts = message.value.timestamp

0 commit comments

Comments
 (0)