0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
Commit Graph

18 Commits

Author SHA1 Message Date
Michael Matloka
3e5b073ade
Run broken down analyses with a single SQL query (#5186)
* Remove unused imports

* Rework breakdowns for CTEs instead of separate queries

* Increase happiness of mypy

* Fix formula trends

* remove repeated team_condition

* remove print

Co-authored-by: eric <eeoneric@gmail.com>
2021-07-21 14:00:34 -04:00
Michael Matloka
72f67b1fc4
Fix funnel trends step indexes (#5172)
* Fix funnel trends `to_step` default

* Make steps 0-indexed in funnel trends too
2021-07-20 11:06:24 +01:00
Li Yi Yu
973af368cd
Return correct chart tooltip date (#5135) 2021-07-15 12:05:36 -05:00
Michael Matloka
871024f8c6
Funnel trends persons (#5060)
* JOIN in funnel trends query in a more optimal way

* Reformat funnel trends assert slightly

* Refactor `ClickhouseFunnelTrends` slightly

* Add `ClickhouseFunnelTrendsPersons` code

* Allow parametrization of funnel trends persons query

* Update test_funnel_trends.py

* Clean some funnel analysis code up

* Fix `drop_off` default in `FunnelTrendsPersonsMixin`

* Refactor for `ClickhouseFunnelTrends.get_step_counts_without_aggregation_query`

* Update test_funnel_trends.py

* Add an API test for funnel trends persons

* Use `FUNNEL_PERSONS_BY_STEP_SQL`

* Tests persons some more

* Remove unused imports
2021-07-13 09:57:19 +00:00
Michael Matloka
510066b4d3
Funnel trends query cleanup (#5058)
* JOIN in funnel trends query in a more optimal way

* Reformat funnel trends assert slightly
2021-07-09 15:41:23 +01:00
Michael Matloka
a76959bb2a
Fix inefficient and erroneous insight cache updating (#5051) 2021-07-08 19:03:56 -05:00
Neil Kakkar
7954477ba7
Refactor some base Funnel query components (#5037) 2021-07-08 17:25:58 +00:00
Neil Kakkar
6394988e11
Mix and Match ordering and visualization of funnels (#5031) 2021-07-08 16:38:42 +00:00
Michael Matloka
2f5266e2cf
Funnel time to convert query (#4947)
* Create funnel_time_to_convert.py

* Create test_funnel_time_to_convert.py

* Remove unused things

* Rework time to convert query to use our own SQL

* Add comments to query

* Fix typo in comment

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>

* Use feedback

* Only override `ClickhouseFunnelTimeToConvert._format_results`

* Switch test users B and C around

* Fix typo

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 13:41:11 -04:00
Neil Kakkar
e60e3c7964
Setup Funnel Unordered persons and Testing (#4943)
* wip: pagination for persons on clickhouse funnels

* wip: added offset support for getting a list of persons; added support for conversion window;

* fixed mypy exception

* helper function to insert data for local testing

* moved generate code into separate class for more functionality later

* corrected person_distinct_id to use the person id from postgres

* minor corrections to generate local class along with addition of data cleanup via destroy() method

* reduce the number of persons who make it to each step

* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;

* funnel persons and tests

* initial implementation

* invoke the funnel or funnel trends class respectively

* add a test

* add breakdown handling and first test

* add test stubs

* remove repeats

* mypy corrections and PR feedback

* run funnel test suite on new query implementation

* remove imports

* corrected tests

* minor test updates

* correct func name

* fix types

* unordered step and test

* func name change

* move builder functions to funnel base

* add test classe for new funnel

* resolve issues with unordered funnel

* oops

* remove breakdown, fix mypy error

* Handle multiple same events in the funnel (#4863)

* dedup + tests

* deep equality. Tests to come

* write test for entity equality

* finish testing funnels

* clean up comments

* from O(2^N) to O(N)

* add query intuition blurb

* rm todo

* wip persons

* wip persons 2

* address comments

* test things, fix bugs

* match result format to funnel.py

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 12:11:54 -04:00
Michael Matloka
662e979367
Ignore breakdown in funnel trends (#4948) 2021-06-30 17:36:51 +02:00
Eric Duong
628b431b6c
Revert "Revert "Allow specifying from and to steps in funnel trends in API (#4914)" (#4931)" (#4932)
This reverts commit 8c06f9aa72.
2021-06-29 20:16:48 -04:00
Eric Duong
8c06f9aa72
Revert "Allow specifying from and to steps in funnel trends in API (#4914)" (#4931)
This reverts commit 87188ee1b2.
2021-06-29 20:09:33 -04:00
Michael Matloka
87188ee1b2
Allow specifying from and to steps in funnel trends in API (#4914)
* adjust comment

* add caveat

* Clarify funnel trends description and terminology more

* Add a test to nail an assumption down

* Add `FunnelTrendsMixin` to `Filter` to control funnel trends better

* Fix `TestFunnelTrends

* Fix `FunnelTrendsMixin` method name

* Make mypy comfy

* Update dict keys in `TestFunnelTrends`

* Rework mixin

* Fix `test_to_dict`

* Move defaulting funnel trends steps from Filter mixin to query class

* Delete funnel_trends.py

* Update comment

Co-authored-by: eric <eeoneric@gmail.com>
2021-06-29 23:27:11 +02:00
Eric Duong
41754f982f
Funnel trends comment adjustment (#4894)
* adjust comment

* add caveat

* Clarify funnel trends description and terminology more

* Add a test to nail an assumption down

* Fix `TestFunnelTrends

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-06-29 18:11:40 +02:00
Michael Matloka
4b0c163eb8
New funnel trends query (#4875)
* wip: pagination for persons on clickhouse funnels

* wip: added offset support for getting a list of persons; added support for conversion window;

* fixed mypy exception

* helper function to insert data for local testing

* moved generate code into separate class for more functionality later

* corrected person_distinct_id to use the person id from postgres

* minor corrections to generate local class along with addition of data cleanup via destroy() method

* reduce the number of persons who make it to each step

* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;

* funnel persons and tests

* initial implementation

* invoke the funnel or funnel trends class respectively

* add a test

* add breakdown handling and first test

* add test stubs

* remove repeats

* mypy corrections and PR feedback

* run funnel test suite on new query implementation

* remove imports

* corrected tests

* minor test updates

* correct func name

* fix types

* func name change

* Make `SHELL_PLUS_PRINT_SQL` clearer

* Add ClickhouseFunnelTrendsNew

* Create test_funnel_trends_new.py

* Create test_funnel_trends_v2.py

* move builder functions to funnel base

* add test classe for new funnel

* Inherit from `ClickhouseFunnelNew` and fix intervals

* Add proper formatting of trends results

* Clean tests up a little bit

* Group `FunnelWindowDaysMixin` tests in `test_funnel_persons`

* Rename `ClickhouseFunnelTrendsNew` things for clarity

* Port some original `ClickhouseFunnel` trends tests for the new query

* Only fetch initial page (100) of persons in trends query

* Describe assumptions and rename things

* Finish porting old ClickhouseFunnelTrends tests and add some new ones

* Remove unused imports

* Try to fix `test_period_not_final`

* Try to fix `test_period_not_final` again

* remove persons lists

* rename

* fix test

* add timezone to results

* add funnel trends new to api path

* revert random change

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-06-28 18:48:35 -04:00
Eric Duong
41aa793ce3
Funnel step query new (#4851)
* wip: pagination for persons on clickhouse funnels

* wip: added offset support for getting a list of persons; added support for conversion window;

* fixed mypy exception

* helper function to insert data for local testing

* moved generate code into separate class for more functionality later

* corrected person_distinct_id to use the person id from postgres

* minor corrections to generate local class along with addition of data cleanup via destroy() method

* reduce the number of persons who make it to each step

* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;

* funnel persons and tests

* initial implementation

* invoke the funnel or funnel trends class respectively

* add a test

* add breakdown handling and first test

* add test stubs

* remove repeats

* mypy corrections and PR feedback

* run funnel test suite on new query implementation

* remove imports

* corrected tests

* minor test updates

* correct func name

* fix types

* func name change

* move builder functions to funnel base

* add test classe for new funnel

* Handle multiple same events in the funnel (#4863)

* dedup + tests

* deep equality. Tests to come

* write test for entity equality

* finish testing funnels

* clean up comments

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2021-06-28 10:20:08 -04:00
Buddy Williams
d9de6186d2
Funnels reorganization, persons pagination, and conversion window support (#4810)
* wip: pagination for persons on clickhouse funnels

* wip: added offset support for getting a list of persons; added support for conversion window;

* fixed mypy exception

* helper function to insert data for local testing

* moved generate code into separate class for more functionality later

* corrected person_distinct_id to use the person id from postgres

* minor corrections to generate local class along with addition of data cleanup via destroy() method

* reduce the number of persons who make it to each step

* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;

* funnel persons and tests

* invoke the funnel or funnel trends class respectively

* mypy corrections and PR feedback

* corrected tests

Co-authored-by: eric <eeoneric@gmail.com>
2021-06-23 21:49:39 -04:00