Skip to content

Commit b10ddac

Browse files
committed
typing
1 parent 989caf2 commit b10ddac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sentry/workflow_engine/metric_helpers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ def create_metric_data_condition(alert_rule_trigger: AlertRuleTrigger) -> None:
7878
else DetectorPriorityLevel.HIGH
7979
)
8080
threshold_type = alert_rule_trigger.alert_rule.threshold_type
81+
if not threshold_type:
82+
return None
8183
# XXX: we read the threshold type off of the alert_rule and NOT the alert_rule_trigger
8284
# alert_rule_trigger.threshold_type is a deprecated feature we are not moving over
8385

8486
data_condition = DataCondition.objects.create(
85-
condition=threshold_to_condition[threshold_type],
87+
condition=threshold_to_condition.get(threshold_type, AlertRuleThresholdType.ABOVE.value),
8688
comparison=alert_rule_trigger.alert_threshold,
8789
condition_result=condition_result,
8890
type=ConditionType.METRIC_CONDITION,

0 commit comments

Comments
 (0)