Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
ceorourke committed Dec 13, 2024
1 parent 989caf2 commit b10ddac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sentry/workflow_engine/metric_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ def create_metric_data_condition(alert_rule_trigger: AlertRuleTrigger) -> None:
else DetectorPriorityLevel.HIGH
)
threshold_type = alert_rule_trigger.alert_rule.threshold_type
if not threshold_type:
return None
# XXX: we read the threshold type off of the alert_rule and NOT the alert_rule_trigger
# alert_rule_trigger.threshold_type is a deprecated feature we are not moving over

data_condition = DataCondition.objects.create(
condition=threshold_to_condition[threshold_type],
condition=threshold_to_condition.get(threshold_type, AlertRuleThresholdType.ABOVE.value),
comparison=alert_rule_trigger.alert_threshold,
condition_result=condition_result,
type=ConditionType.METRIC_CONDITION,
Expand Down

0 comments on commit b10ddac

Please sign in to comment.