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

450 Commits

Author SHA1 Message Date
Neil Kakkar
796fa106fe
Add missing interval value (#5398) 2021-08-02 14:25:13 +01:00
Karl-Aksel Puulmann
bb8e7f46e0
Count query as failed if it takes > 15s (#5372)
* Count query as failed if it takes > 15s

* Use perf_counter()

* Add minimal comments

* Rename method for clarity
2021-07-30 17:04:03 +03:00
Neil Kakkar
06db796376
Constrain trends results to generated values (#5368)
Similar to: https://github.com/PostHog/posthog/pull/5316
2021-07-29 14:30:40 +03:00
Karl-Aksel Puulmann
8e10a90b32
Implement workaround for reading person_distinct_ids (#5355)
* Implement workaround for reading person_distinct_ids

Context under https://github.com/PostHog/product-internal/issues/114

Hopefully a temporary workaround!

* Update query

* use print

* match stickiness test

* match stickiness and trends cohort paths

* bring back distinct_id query

* revert unrelated change

* reutrn to original

* reformat

* run again

* comment out test

Co-authored-by: eric <eeoneric@gmail.com>
2021-07-28 14:51:26 -04:00
Karl-Aksel Puulmann
1463b3e1b7
Revert person.distinct_ids column (#5354)
* Revert https://github.com/PostHog/posthog/pull/5276

* Update ee/clickhouse/migrations/0014_persons_distinct_ids_column_remove.py

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

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2021-07-28 16:02:05 +03:00
Eric Duong
a01a5edca2
Add more options for funnel windowing (#5329)
* add more options for funnel windowing

* tweaks

* add test

* accomodate any case and make to_dict smaller

* remove import

* change name

* store lower

* fix test
2021-07-27 13:09:29 -04:00
Eric Duong
708ce2bb59
Funnel trends breakdown (#5232)
* partial implementation

* working event breakdown

* remove hardcoded fill

* add person test

* remove test unneeded

* use original breakdown implementation

* add cohort handling

* add clause lost on merge
2021-07-27 12:17:14 -04:00
Eric Duong
37ac7feffe
Fix derivative step bug for funnels (#5337)
* add includes method and tests for derivative steps

* make suggested changes

* return to original and add comment

* change name
2021-07-27 15:07:48 +00:00
Neil Kakkar
421732b652
Allow Excluding Multiple Events + events in unordered funnels (#5150)
* clean up, more tests, docs

* ensure correct filter values get saved to cache

* exclusion in unordered funnels
2021-07-27 10:10:37 +01:00
Karl-Aksel Puulmann
891e6e6fe8
Fix filtering entity by cohort (#5338)
Previously, this flow broke in insights:
1. Select event/action
2. Select filter for that event/action containing cohort

Fixes https://github.com/PostHog/posthog/issues/5325
2021-07-27 09:59:41 +01:00
Alex Gyujin Kim
e7f89597d5
Standardize date and time formatting across app (#5332)
* standardize dates and times across app

* fix tests

* fix postgres tests

* some more fixed tests
2021-07-27 01:46:20 +00:00
Neil Kakkar
259d12d6cf
Ensure time_to_convert bins stay uniform (#5316)
* ensure bins stay uniform

* rm offending line
2021-07-23 10:40:17 -04:00
Karl-Aksel Puulmann
0c5852f586
Update comment style to be copyable (#5281) 2021-07-23 13:15:59 +03:00
Eric Duong
f6e5a2b6a8
Make sure values are populated and persons paginate properly (#5305) 2021-07-23 10:47:48 +01:00
Neil Kakkar
9090918e5c
Resolve caching issues with persons breakdown (#5292) 2021-07-22 17:33:58 +00:00
Eric Duong
8e615e3635
make sure values are properly labeled and table names are accounted for (#5288) 2021-07-22 12:59:20 -04:00
Neil Kakkar
ca724e1f81
Resolve errors with time to convert bins (#5283)
* time to convert test

* rworkaround for time to convert bins

* address comment
2021-07-22 14:04:05 +00:00
Li Yi Yu
9b69a71e6d
Fix persons modal load more people (#5271)
* count display update

* do not reload list of people when loading more people

* Revert "do not reload list of people when loading more people"

This reverts commit eb9ef11690.

* fix flag

* separate initial loading state

* update title with "+", fix person/persons

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-07-22 13:49:57 +02:00
Neil Kakkar
b8c946cf99
Fix Funnel Trends Persons with month/week granularity (#5277)
* resolve #5275

* address comment
2021-07-22 11:49:15 +00:00
Karl-Aksel Puulmann
211c6e762f
Add migration for distinct_id column on clickhouse person table (#5276)
* Add migration for `distinct_id` column on clickhouse

Note that code under ee/clickhouse/models/person.py does not work
anymore since it does not populate the column correctly. That is fine -
will be handled when doing the actual migration, rather than for this
experiment.

* Update plugin server to 1.1.8

Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-07-22 14:30:12 +03:00
Neil Kakkar
a0b99facec
Fix issues with step conversion times (#5174)
* general conversion time cases

* clean cases

* remove ch bug test for now
2021-07-22 09:31:47 +01:00
Eric Duong
39416b7e94
Revert "Run broken down analyses with a single SQL query (#5186)" (#5272)
This reverts commit 3e5b073ade.
2021-07-21 19:29:27 -04:00
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
Eric Duong
cedf33c891
Add median time for funnel conversion data (#5203)
* add median time for conversion steps

* patch tests

* fix time to convert funnel query

* fix strict and unordered

* add median conversion time to base

* fix

* more tests
2021-07-20 13:36:22 -04:00
Eric Duong
993278ad46
Fix single cohort bug (#5225)
* fix single cohort bug

* fix test name
2021-07-20 16:27:41 +00:00
Eric Duong
8b6b6ae9bb
Fix broken funnel pagination (#5178)
* fix broken funnel pagination

* account for both return results

* add limit param

* move order

* move the check

* change magic number

* adjust more tests
2021-07-20 11:34:15 -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
Karl-Aksel Puulmann
fc5c6476a0
Revert "Revert "Add is_deleted column to person_distinct_id"" (#5194)
* Revert "Revert "Add is_deleted column to person_distinct_id (#5151)" (#5193)"

This reverts commit 401268bdba.

* A tweak for docker-compose builds

Co-authored-by: James Greenhill <fuziontech@gmail.com>
2021-07-19 19:47:41 -07:00
Alex Gyujin Kim
d9973c7e5d
Add all steps option to time conversion funnel (#5142)
* add all steps option

* all steps working; add total and mean time to convert

* change display type checks to use enum

* kea types

* dangling console log

* Add average conversion time to time to convert results

* respond to feedabck

* responsive histogram sizes

* merged @Twixes backend changes; adjust data shape on frontend; add responsiveness to histogram

* add tooltip label

* adjust copy and tooltip

* minor tweaks

* respond to general feedback

* kea auto

* better empty state:

* error handling null time bins

* fix tests

Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-19 12:00:59 -07:00
Karl-Aksel Puulmann
401268bdba
Revert "Add is_deleted column to person_distinct_id (#5151)" (#5193)
This reverts commit b1c11ba7dc.
2021-07-19 12:57:42 +03:00
Karl-Aksel Puulmann
b1c11ba7dc
Add is_deleted column to person_distinct_id (#5151)
* Update PERSONS_ACTIVE_USER_SQL query

* Remove dead import

* Update lifecycle queries

* Update BREAKDOWN_ACTIVE_USER_INNER_SQL to use new persons query

* Update STICKINESS_SQL

* Update STICKINESS_PEOPLE_SQL

* Update STICKINESS_ACTIONS_SQL

* Update paths query

* Update events query

* Update CALCULATE_COHORT_PEOPLE_SQL

* Update retention queries

* Update TOP_PERSON_PROPS_ARRAY_OF_KEY_SQL

* Update EVENT_JOIN_PERSON_SQL

* Update GET_PERSON_ID_BY_ENTITY_COUNT_SQL

* Remove remaining references to old get latest person query

* Update GET_DISTINCT_IDS_BY_PROPERTY_SQL

* Fix code style issue

* Update table engine for person_distinct_id table

* don't select team_id

* Make person deletion work

* Use replacingmergetree over collapsing with is_deleted

Replacing an existing engine is hard, let's not do it

* Update query in test

* add migration

* set database on materialized views

* Update plugin server to 1.1.6

Co-authored-by: James Greenhill <fuziontech@gmail.com>
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-07-19 12:43:44 +03:00
Karl-Aksel Puulmann
9b7ffe1424
Kill dead code around updating person properties (#5146)
* Kill dead code around updating person properties

This caused some confusion around mutations that got queued. Dead code =
bad code

* Remove unused imports

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-07-16 14:51:32 +00:00
James Greenhill
751a35cd35
Make DDLs more friendly towards running on a cluster and cleanups (#5091)
* Make DDLs more friendly towards running on a cluster

* Use primary CLICKHOUSE host for migrations and DDL

* loose ends on person kafka create

* posthog -> cluster typo

* add cluster to KAFKA create for plugin logs

* Feed the type monster

* clusterfy local clickhouse

* test docker-compose backed github action

* run just clickhouse and postgres from docker-compose

* move option to between up and <services>

* posthog all the things

* suggest tests run on  cluster

* posthog cluster for ci

* use deploy path for docker-compose

* fix for a clickhouse bug 🐛

* complete CH bug fixes

* 5439 the github actions pg configs

* remove CLICKHOUSE_DATABASE (handled automatically)

* update DATABASE_URL for code quality checks

* Missed a few DDLs on Person

* 5439 -> 5432 to please the people

* cleanup persons and use f strings <3 f strings

* remove auto parens

* Update requirements to use our fork of infi.clickhouse_orm

* fix person.py formatting

* Include boilerplate macros for a cluster
2021-07-15 17:20:37 -07:00
Eric Duong
7a325c79bd
Add default conditions properly to time to convert params (#5154)
* add default conditions properly

* run again
2021-07-15 14:55:09 -04:00
Li Yi Yu
973af368cd
Return correct chart tooltip date (#5135) 2021-07-15 12:05:36 -05:00
Neil Kakkar
8a1bd1c80e
Add Support for Excluding Events from Funnels (#5104)
* finish for ordered

* clean up, more tests, docs

* ensure correct filter values get saved to cache
2021-07-15 13:42:40 +01:00
Tim Glaser
267dbc7402
Use denormalised props in trends (#5148) 2021-07-15 12:35:06 +02:00
Eric Duong
696b9fee24
Add clause and test for static cohorts event query (#5144)
* add clause and test

* add default
2021-07-15 00:05:59 -04:00
Eric Duong
1193818359
fix static cohort using precalculated query bug (#5132) 2021-07-14 23:15:10 -04:00
Michael Matloka
3ca42efd87
Allow time to convert across multiple steps (or whole funnel) (#5110)
* Allow time to convert across multiple steps (or whole funnel)

* Update comments
2021-07-14 13:17:24 +02:00
Eric Duong
bcffcde783
Add a test to make sure funnel cohort persons is returned (#5103)
* add a test to make sure funnel cohort persons is returned

* delete comment

* checking persons on cohort return in original test
2021-07-13 11:15:12 -04:00
Tim Glaser
543d567c5b
Fix denormalised props funnels (#5101)
* Fix denormalised props funnels

* fix settings

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2021-07-13 13:13:45 +00: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
Eric Duong
ec53a13e1c
Funnel cohort breakdown (#5053)
* index the cohort params

* remove extra condition

* cohort working
2021-07-13 09:52:36 +01:00
Eric Duong
ad90717903
funnel bug if breakdown_type not passed (#5082)
* handle if brekadown type not passed

* move breakdown tests
2021-07-13 09:30:38 +01:00
Neil Kakkar
c554bb5e55
Enable person breakdowns querying for all ordering funnels (#5043)
* first pass mix and match everything

* cleanup

* small refactoring of get_query

* remove top level filter props

* save the file

* enable person breakdowns querying for regular + strict funnels

* move mixin testing to more appropriate location

* add unordered, testing quality of life improvements

* clean up

* add strict+unordered connectivity test for time to convert

* trim after extracting

* clean up, fix tests, trim everywhere
2021-07-12 18:53:26 +02:00
Karl-Aksel Puulmann
ac0ef1b30e
Load session events async on clickhouse (#5056)
* Load session events asynchronously from a separate endpoint

This mirrors the behavior of postgres query

* Simplify backend & query

event_count is unused
don't select unused columns in list query

* Rename filter_by_session_recordings to filter_by_session_recordings

This is more in-line with what the function actually does

* Update types, handle start/end url properly

* start_url / end_url to session result

* Update sessions list builder tests

* Remove some `session.events` references

* Remove unneeded code

* Simplify filteredSessions

* Fix type issue

* Add test for session properties

* Test and fix start_url/end_url

* Add test for the new sessions API endpoint

* Improve types

* Update py types again

* Fix bug
2021-07-12 10:43:40 +03: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
Eric Duong
fd20a81891
Index the cohort params (#5049)
* index the cohort params

* remove extra condition
2021-07-08 19:00:15 -04:00