Skip to content

Commit

Permalink
reF(py): Update monitor_consumer to handle FilteredPayload
Browse files Browse the repository at this point in the history
This is primarily a typing adjustment. Since we're not actually using
FilterStep we're never going to actualy get a FilteredPayload.
  • Loading branch information
evanpurkhiser committed Apr 29, 2024
1 parent 2c12dad commit 46bbb94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sentry/monitors/consumers/monitor_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from arroyo.processing.strategies.batching import BatchStep, ValuesBatch
from arroyo.processing.strategies.commit import CommitOffsets
from arroyo.processing.strategies.run_task import RunTask
from arroyo.types import BrokerValue, Commit, Message, Partition
from arroyo.types import BrokerValue, Commit, FilteredPayload, Message, Partition
from django.db import router, transaction
from sentry_kafka_schemas import get_codec
from sentry_kafka_schemas.codecs import ValidationError
Expand Down Expand Up @@ -910,7 +910,10 @@ def process_batch(executor: ThreadPoolExecutor, message: Message[ValuesBatch[Kaf
logger.exception("Failed to trigger monitor tasks")


def process_single(message: Message[KafkaPayload]):
def process_single(message: Message[KafkaPayload | FilteredPayload]):
if isinstance(message.payload, FilteredPayload):
return

assert isinstance(message.value, BrokerValue)
try:
try:
Expand Down

0 comments on commit 46bbb94

Please sign in to comment.