Skip to content

Commit

Permalink
fix(experiments): Add a WHERE statement to ASOF LEFT JOIN (#26848)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber authored Dec 11, 2024
1 parent be16a0d commit 8786c87
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions posthog/warehouse/models/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ def _join_function_for_experiments(
}.items()
],
select_from=ast.JoinExpr(table=ast.Field(chain=["events"])),
where=ast.CompareOperation(
op=ast.CompareOperationOp.Eq,
left=ast.Field(chain=["event"]),
right=ast.Constant(value="$feature_flag_called"),
),
),
# ASOF JOIN finds the most recent matching event that occurred at or before each data warehouse timestamp.
#
Expand Down

0 comments on commit 8786c87

Please sign in to comment.