-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Setup Funnel Unordered persons and Testing #4943
Merged
Merged
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
537bdb3
wip: pagination for persons on clickhouse funnels
buwilliams 605f9de
wip: added offset support for getting a list of persons; added suppor…
buwilliams a9a5f12
fixed mypy exception
buwilliams e952308
helper function to insert data for local testing
buwilliams ceda12e
moved generate code into separate class for more functionality later
buwilliams 1a29fdb
corrected person_distinct_id to use the person id from postgres
buwilliams 1990907
minor corrections to generate local class along with addition of data…
buwilliams 7daeaaa
reduce the number of persons who make it to each step
buwilliams fba259e
moved funnel queries to a new folder for better organization; separat…
buwilliams cc24758
Merge branch 'master' into funnel-persons-pagination-conversion-window
EDsCODE 142e7b6
funnel persons and tests
buwilliams df44123
Merge branch 'funnel-persons-pagination-conversion-window' of github.…
buwilliams 589e937
initial implementation
EDsCODE ac6d601
invoke the funnel or funnel trends class respectively
buwilliams 34d5bad
add a test
EDsCODE b483277
add breakdown handling and first test
EDsCODE 9242414
add test stubs
EDsCODE 3042e59
remove repeats
EDsCODE 474ba42
mypy corrections and PR feedback
buwilliams 4abecaf
run funnel test suite on new query implementation
EDsCODE 62f2919
remove imports
EDsCODE 4fb5a43
corrected tests
buwilliams 74bfa1b
minor test updates
EDsCODE 0aa36f9
Merge branch 'funnel-persons-pagination-conversion-window' into funne…
EDsCODE 5c9dcd2
correct func name
EDsCODE 5df0cad
fix types
EDsCODE d7d2e60
merge master
EDsCODE a9e9b7f
unordered step and test
neilkakkar 0427159
func name change
EDsCODE b9cae01
move builder functions to funnel base
EDsCODE 7c5e606
add test classe for new funnel
EDsCODE 49f8c92
Merge branch 'master' into funnel-step-query-new
EDsCODE 0938b92
resolve issues with unordered funnel
neilkakkar 4420421
resolve merge conflicts
neilkakkar ae21c8c
oops
neilkakkar b3fa339
remove breakdown, fix mypy error
neilkakkar 716e8af
Handle multiple same events in the funnel (#4863)
neilkakkar 79cbea2
Merge branch 'funnel-step-query-new' of github.com:PostHog/posthog in…
neilkakkar 6c4245f
from O(2^N) to O(N)
neilkakkar 6d1f8f1
merge master
EDsCODE 001a149
add query intuition blurb
neilkakkar 1372f68
rm todo
neilkakkar a54db4e
wip persons
neilkakkar 7857487
wip persons 2
neilkakkar 74e72cd
Merge branch 'master' of github.com:PostHog/posthog into funnel-unord…
neilkakkar 1bfa011
address comments
neilkakkar aa71b6d
merge master
neilkakkar 9b8df58
Merge branch 'funnel-unordered-step' of github.com:PostHog/posthog in…
neilkakkar c46dc07
test things, fix bugs
neilkakkar a11eeed
resolve merge conflicts
neilkakkar f4d9b58
Merge branch 'master' into funnel-unordered-persons
neilkakkar a13add8
Merge branch 'master' into funnel-unordered-persons
EDsCODE d330e34
match result format to funnel.py
EDsCODE 2d9ea97
Merge branch 'master' into funnel-unordered-persons
EDsCODE File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from ee.clickhouse.queries.funnels.funnel_unordered import ClickhouseFunnelUnordered | ||
from ee.clickhouse.sql.funnels.funnel import FUNNEL_PERSONS_BY_STEP_SQL | ||
from posthog.models import Person | ||
|
||
|
||
class ClickhouseFunnelUnorderedPersons(ClickhouseFunnelUnordered): | ||
def get_query(self, format_properties): | ||
return FUNNEL_PERSONS_BY_STEP_SQL.format( | ||
**format_properties, | ||
steps_per_person_query=self.get_step_counts_query(), | ||
persons_steps=self._get_funnel_person_step_condition() | ||
) | ||
|
||
def _format_results(self, results): | ||
people = Person.objects.filter(team_id=self._team.pk, uuid__in=[val[0] for val in results]) | ||
|
||
from posthog.api.person import PersonSerializer | ||
|
||
return PersonSerializer(people, many=True).data |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Eventually, I think visualisation like Trends should inherit from the different types of ordered funnels, and use their now-new
get_step_counts_query()
as the seed query, but now's not the time for it. ( Want atleast a pattern of 2 before we generalise, so we don't create the wrong abstractions)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.
yup, agreed