Skip to content

Commit

Permalink
fix(trend experiments): filter insight results correctly (#20080)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik authored Feb 1, 2024
1 parent 46ec36c commit cb12ce0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ee/clickhouse/queries/experiments/trend_experiment_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ def get_variants(self, insight_results, exposure_results):
exposure_counts = {}
exposure_ratios = {}

# :TRICKY: With count per user aggregation, our exposure filter is implicit:
# (1) We calculate the unique users for this event -> this is the exposure
# (2) We calculate the total count of this event -> this is the trend goal metric / arrival rate for probability calculation
# TODO: When we support group aggregation per user, change this.
if uses_math_aggregation_by_user_or_property_value(self.query_filter):
filtered_exposure_results = [
result for result in exposure_results if result["action"]["math"] == UNIQUE_USERS
Expand Down

0 comments on commit cb12ce0

Please sign in to comment.