-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Excluding Multiple Events + events in unordered funnels #5150
Conversation
posthog/models/entity.py
Outdated
@@ -89,6 +90,11 @@ class ExclusionEntity(Entity, FunnelFromToStepsMixin): | |||
def __init__(self, data: Dict[str, Any]) -> None: | |||
super().__init__(data) | |||
|
|||
@property | |||
def sql_id(self): | |||
# TODO: prevent SQL injection :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably just using a UUID here works.
Had other higher priority bugs to look into, will come back to this on Tuesday.
to_time = f"event_times[{exclusion.funnel_to_step + 1}]" | ||
exclusion_time = f"exclusion_{exclusion_id}_latest_{exclusion.funnel_from_step}" | ||
condition = ( | ||
f"if( {exclusion_time} > {from_time} AND {exclusion_time} < " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the "<" supposed to be trailing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple strings! These get concatenated automatically when enclosed in a paranthesis.
Felt clearer to me, about what's happening in the "<" (the next line)
Don't merge until SQL injection issue is resolved~~To go after #5104 ~~
Fixes #5074
Changes
Event exclusion in unordered events
Support for multiple exclusions in the same step in ordered + unordered funnels
Checklist