fix(): business logic fixes and code refactoring
This commit is contained in:
@@ -129,7 +129,7 @@ def calculate_metric_value(
|
||||
if not decision_ids:
|
||||
return None
|
||||
|
||||
metric_type = rule.get("type", metric.metric_type)
|
||||
metric_type = metric.metric_type
|
||||
|
||||
if metric_type == MetricType.RATIO:
|
||||
numerator = _count_events(
|
||||
@@ -145,7 +145,7 @@ def calculate_metric_value(
|
||||
end_date,
|
||||
)
|
||||
if denominator == 0:
|
||||
return Decimal(0)
|
||||
return None
|
||||
return Decimal(str(round(numerator / denominator, 6)))
|
||||
|
||||
if metric_type == MetricType.COUNT:
|
||||
|
||||
Reference in New Issue
Block a user