-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Enable customising which events to consider on Paths #5741
Conversation
class TargetEventsMixin(BaseParamMixin): | ||
@cached_property | ||
def target_events(self) -> List[str]: | ||
return self._data.get(PATHS_INCLUDE_EVENT_TYPES, []) |
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.
@liyiy - do you think there's a better way to pass information down from the frontend?
Right now it looks something like: https://github.com/PostHog/posthog/pull/5741/files#diff-9b53c3a3f635f0fa8c15a295b375b72af36bd9f60f638e833ca20acc609b7a57R325
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.
lgtm
) | ||
|
||
_fields = list(filter(None, _fields)) |
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.
What does this do :O I'd expect filter to accept a lambda. I guess this is a compact-like.
Also nitpick - now the three event query classes have a really different shape. Why?
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.
removes empty strings from the list so when you join with ,
, you don't get , <empty> ,
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.
Explain nitpick? I thought I updated the rest to follow this format?
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.
Ah, trends. Will update, then all 3 will look the same.
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.
Yeah, filter with None is basically a truthy filter: https://docs.python.org/3/library/functions.html#filter
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.
Please wait for #5705 - this change already created a bunch of nasty merge conflicts and rebasing seemingly broke everything.
Worth keeping other WIP in mind when multiple people working on similar things.
Changes
Allows for choosing which events to include and which ones to exclude on Paths
Checklist