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.
@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
| ] | ||
| ) | ||
|
|
||
| _fields = list(filter(None, _fields)) |
There was a problem hiding this comment.
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.
removes empty strings from the list so when you join with ,, you don't get , <empty> ,
There was a problem hiding this comment.
Explain nitpick? I thought I updated the rest to follow this format?
There was a problem hiding this comment.
Ah, trends. Will update, then all 3 will look the same.
There was a problem hiding this comment.
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.
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