Skip to content

Commit

Permalink
goal dimension fix rewrite (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
jancervenka authored Nov 29, 2023
1 parent 87280e6 commit 0eb5b28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ep-stats
version = 2.2.6
version = 2.2.7
description = Statistical package to evaluate ab tests in experimentation platform.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
10 changes: 8 additions & 2 deletions src/epstats/toolkit/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .metric import Metric, SimpleMetric
from .check import Check
from .utils import get_utc_timestamp, goals_wide_to_long
from .parser import EpGoal, UnitType, AggType, Goal
from .parser import Parser, EpGoal, UnitType, AggType, Goal

from .statistics import Statistics, DEFAULT_CONFIDENCE_LEVEL, DEFAULT_POWER
from ..prometheus import get_prometheus_metric, Counter as PrometheusCounter
Expand Down Expand Up @@ -193,7 +193,13 @@ def _update_dimension_to_value(self):
can work properly.
"""

all_goals = [metric_or_check.get_goals() for metric_or_check in self.metrics + self.checks]
all_goals = []
for metric_or_check in self.metrics + self.checks:
for attr in metric_or_check.__dict__.values():
if isinstance(attr, Parser):
all_goals.append(attr._nominator_expr.get_goals())
all_goals.append(attr._denominator_expr.get_goals())

all_goals = chain(*all_goals, self._exposure_goals)

for goal in all_goals:
Expand Down

0 comments on commit 0eb5b28

Please sign in to comment.