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

743 Commits

Author SHA1 Message Date
Eric Duong
a8731a3d00
Add test for defining both a start and end point for path (#5820)
* add test for defining both a start and end point

* add multiple target handling

* fix type

* move param handling

* null condition
2021-09-07 12:00:39 -04:00
Karl-Aksel Puulmann
6014a4f3b5
Follow-up to breakdowns refactor PR (#5826)
Noticed I missed a comment since the thread got resolved 😅
2021-09-07 16:42:22 +03:00
Tim Glaser
79cb5e645c
fix person modal across multiple dates (#5819)
* fix person modal across multiple dates

* test works for pg but shouldn't for ee

* wrong number

* make it cumulative relevant

Co-authored-by: eric <eeoneric@gmail.com>
2021-09-07 15:17:50 +03:00
Karl-Aksel Puulmann
b6b2508233
Make marking materialized columns as MATERIALIZED stateless (#5831)
This simplifies the operational model a lot
2021-09-07 11:53:57 +00:00
Karl-Aksel Puulmann
4306444c2e
Fix issue with person breakdowns and clashing params (#5815)
* Fix issue with person breakdowns and clashing params

Closes https://github.com/PostHog/posthog/issues/5814

Another PR https://github.com/PostHog/posthog/pull/5807 also fixes this
(incidentally) but this fix won't hurt it + adds a regression test.

* Autoimport Property into shell_plus to speed up debugging

* Remove index
2021-09-07 13:36:14 +03:00
Karl-Aksel Puulmann
17836f80f5
Add command for materializing columns (#5816)
* Add command for materializing columns

Expecting this to get used in both dev as well as when improving
upstream installations

* No clashes in tests

* Solve for feedback

* Comments for clarity
2021-09-07 07:56:29 +00:00
Karl-Aksel Puulmann
35813b3b49
Refactor breakdowns to work with materialized person columns (#5807)
* Make breakdown join with person if needed

* Refactor trends to be purely class-based, don't rely on wonky inheritance

* Extract method

* Improve person join behavior

* Remove unneeded parameter

* Mark a function thats always passed as such

* Add test case demonstrating previous non-join case

* Unify two get_breakdown_prop_values methods

* Add test for materialized columns

* Simplify trends breakdown query

* Unify _breakdown_prop_params for events/person breakdowns

* Use shared column_optimizer

* Typing fix

* Cleanup

* Code style cleanup

* Code style cleanup

* Fix param ordering
2021-09-07 09:05:13 +03:00
Karl-Aksel Puulmann
5d6b083c90
Fix uses_elements_chain (#5810)
Closes https://github.com/PostHog/posthog/issues/5808

I'd love to fix this at the schema level but looked into it for ~20
minutes and it didn't seem like there's a pretty solution that allows to
pass `None` to .objects.create and for the default to be used.

Other solutions would be even more invasive and require manipulating
serializers.

Best leave this to when we refactor all of out `properties` JSONFields
since they all have this issue
2021-09-06 16:55:54 +03:00
Karl-Aksel Puulmann
0df87579ab
Add more materialized column settings (#5806) 2021-09-04 18:07:20 +03:00
Eric Duong
33a3c0e238
try to remove redundant filtering (#5782) 2021-09-01 15:40:27 -04:00
Eric Duong
4ac73045de
add missing table name in query (#5781) 2021-09-01 13:51:33 -04:00
Karl-Aksel Puulmann
8d8705d1bb
Materialize person columns automatically (#5760)
* Hotfix: Use materialized columns on cloud

This was broken since default_kind was different on Distributed tables
on cloud

* Improve __init__.py

* Make reverting DEFAULT column async, only ON CLUSTER for events table
2021-08-28 12:14:30 +03:00
Neil Kakkar
9e909855a0
Treat URLs with trailing slash as equivalent in Paths computation, and some bug fixes (#5763)
* fix some path bugs

* cleanup

* dont remove / when only /

* use appendTrailingChar

* revert back

Co-authored-by: eric <eeoneric@gmail.com>
2021-08-27 15:28:01 -04:00
Eric Duong
8709e17c77
Path end point target (#5746)
* make functions dynamic

* add end test

* add adjustments

* remove reverse
2021-08-27 14:38:19 -04:00
Paolo D'Amico
bcf9837e38
SAML - frontend & enforce (#5758) 2021-08-27 09:37:30 -07:00
Paolo D'Amico
627d493817
SAML support (#5681) 2021-08-27 07:20:49 -07:00
Karl-Aksel Puulmann
b2fe0868d7
Proposal: Set mutations_sync in client.py instead of docker config (#5748)
This avoids weird divergence with prod that we need in ee tests but don't
want in e.g. plugin server tests or while developing.
2021-08-26 20:32:01 -07:00
Karl-Aksel Puulmann
0d5df5d3ba
Hotfix: Use materialized columns on cloud (#5753)
This was broken since default_kind was different on Distributed tables
on cloud
2021-08-26 21:29:00 +03:00
Karl-Aksel Puulmann
a8a33251a9
Use materialized person properties in trends & funnels (#5705)
* ColumnOptimizer: Add functionality for person materialized columns

* WIP: Use person properties in trends/funnels

* Test person materialized props in trends cohort breakdown query

* Make use of materialized person properties in breakdowns

* Mark some cases working with materialized columns

* Test and fix breakdown by person props without filtering

* Make filtering by entity/person props on a join work better

By not assuming everything is under `properties`

* Add test case around breakdown with person properties

* Add test cases around materialization

* Add another materialization test

* Test cohorts and fix breakdowns with person filter

This exposes a limitation in the current implementation

* Fix some cohort tests

* Fix event query tests

* Get a funnel materialized column test running

* Cover more funnel breakdown tests with materialized

* Handle person property breakdowns in funnels

* Fixup funnel typo

* Add tests, fix an indentation issue

* TestFunnelPersons with materialized columns

* Test funnels against actions with person filters

* Add failing test for entity filtering failing

* Add test case for filtering with entity properties

* Show my 'broken' test is actually doing a subquery

* Resolve linting issues
2021-08-26 18:00:49 +00:00
Michael Matloka
84dc2b0324
Rework SessionsPlayerButton and clean up Sessions UI (#5745)
* Refactor `PersonModal` and clean related components up a little

* Improve footer button conditions

* Remove unused vars

* Clean up session recordings table

* Rework `SessionsPlayerButton`

* Fix color of play button for viewed recordings

* Fix typing issue

* Fix tests

* Update Sessions.cy-spec.js

* Address feedback

* Simplify button styles

* Add tooltip
2021-08-26 19:17:30 +02:00
Karl-Aksel Puulmann
10a26d3e17
Automatically create materialized properties (#5744)
* Avoid naming collisions when materializing columns

1. Prefix person properties differently. Mixing them up can break
ambigious column issues
2. When name already exists, suffix with random junk :)

* Implement analyze.py

* Add `suggested_columns_to_materialize`

* Add code to backfill a materialized column

* Add tests for backfilling data

* Cleanup

* Add tests for analyze

* WIP: Crontab for materializing columns

* Nooped task for materializing properties

* Use mutations_sync=0 for column tests

* Add comment
2021-08-26 18:48:57 +03:00
Neil Kakkar
6b916c986b
Enable customising which events to consider on Paths (#5741)
* merge master

* allow inclusion and exclusions on Paths

* fix test
2021-08-26 09:34:07 +00:00
Eric Duong
bf51de1162
Funnel persons path (#5699)
* initial implementation

* add basic test

* move timestamp select

* fix tests and types

* fix test
2021-08-25 12:02:49 +01:00
Karl-Aksel Puulmann
71e724bb1a
Proposal: Make funnel entity list unique (#5734)
Looking at the generated SQL it has bothered me that the list of entity
names is not unique for funnels in queries like `event IN [somearray]`

This tries to fix that.
2021-08-25 11:36:28 +02:00
Tim Glaser
92bd10ffa5
Speed up EE tests by not destroying tables (#5715)
* Speed up EE tests by not destroying tables

* Fix broken tests

* Speed up tests by not running migrations

* Fix last test

* req file?

* caching

* Parallel

* revert exp

* debug without parallel

* Revert "debug without parallel"

This reverts commit 83b3ad633f.

* Undo parallel tests

* Speed up more tests

* use final

* correct final

* print exception

* more prints

* move test

* add filter

* remove duplicate test

* prints here

* test wait

* set variable in query

* remove mutations_sync

* cleanup

Co-authored-by: eric <eeoneric@gmail.com>
2021-08-25 10:58:09 +02:00
James Greenhill
b9dc2d9540
Include users.xml config for dev/test clickhouse instance (#5732) 2021-08-25 01:47:15 +00:00
Eric Duong
7b33153f44
add order clause and test (#5722) 2021-08-24 16:39:51 +00:00
Neil Kakkar
8da25427d5
Add Path Timings (#5693) 2021-08-24 15:22:16 +01:00
Neil Kakkar
8158ccb0b3
Respect conversion window for conversion time (#5688)
* count conversion time only when within conversion window
* tests
2021-08-24 11:59:49 +01:00
Karl-Aksel Puulmann
9ba4986688
Fix behavior for is_set/is_not_set operator behavior on materialized columns (#5707)
Given that the extracted value is '' if value is not present we need to
leverage that.
2021-08-24 11:58:05 +01:00
Karl-Aksel Puulmann
c9003a8260
Better test coverage for materialized columns (#5682)
* Remove dead argument

* Make allow_denormalized_props always explicit

* Change prop_clauses default

* Create a testing decorator for checking materialized columns

This makes it easier to have proper test coverage for materialized
columns and make sure no bugs creep up :)

* Fix event_query

* Test more materialized columns in trends

* Add materialized column tests for funnels

* Cleanup path_event_query

* Fix default

* Fix issue with clashing parameter names
2021-08-23 17:17:24 +03:00
Michael Matloka
6e77872cb1
Fix formula + breakdown combination (#5674)
* Add a test case for the problem

* Fix test case

* Fix problem

* Remove debug line

* Move quirk comment to Python-only
2021-08-23 13:16:19 +00:00
Eric Duong
04b751ebd9
Path step limit param (#5675)
* add step limit param

* step limit test

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2021-08-23 11:53:44 +00:00
Karl-Aksel Puulmann
fe594c4350
Clean up DebugCHQueries viewset (#5685) 2021-08-23 12:17:12 +02:00
Neil Kakkar
da305f8000
Error out on exclusion event being same as funnel step (#5668)
* error out on exclusion event being same as funnel step

* remove import
2021-08-23 09:20:34 +02:00
Eric Duong
06c5c6f7a4
New Paths Query (#5646)
* initial implementation

* debug some tests and revert format to original

* some minor cleanup

* add screen handling

* start point handling

* improve indexing so multiple sessions by the same user are handled properly

* all tests passing

* fix type

* fix types

* change types

* more types

* rename base paths

* upgrade start point functionality

* assertEquals, remove inequality

* Revert "assertEquals, remove inequality"

This reverts commit 5eb229fef7.

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2021-08-20 14:33:21 -04:00
Paolo D'Amico
4afe5999bb
Auth updates & fix login as (#5670) 2021-08-20 10:01:33 -07:00
Michael Matloka
4e02411eda
Fix fetching event-based breakdown values with LIMIT (#5496)
* Fix fetching event-based breakdown values with `LIMIT`

* Improve test comment

* Limit prop clauses inclusion to breakdown queries

* Address feedback partly

* Fix imports

* Remove non-3.7-compatible `Literal`

* Don't try to import `Literal`

* Fix oversight

* Always include prop filters in `get_entity_filtering_params`

* Revert "Always include prop filters in `get_entity_filtering_params`"

This reverts commit 4f61edd19a.

* Add and test handling of actions in addition to events

* Update test_funnel.py

* Move new tests to `breakdown_cases`
2021-08-20 16:48:00 +02:00
Michael Matloka
420d8000c1
Support href/text element filters (#5654)
* Fix `icontains` and support `href/`text` element filters

* Test `is_set`/`is_not_set` too

* Require newer `flake8` to support Py 3.8 walrus operator

* Better handle empty mutlivalue operators and support doublequotes

* Polish all element filtering cases

* Roll back general `icontains` fix

* Make minor improvements
2021-08-20 13:53:15 +02:00
Michael Matloka
e590129771
Fix icontains in ClickHouse (#5657) 2021-08-20 10:46:19 +02:00
Neil Kakkar
b484d34c90
Remove unused breakdown query variables (#5655) 2021-08-19 14:04:06 +00:00
Karl-Aksel Puulmann
0f58482a66
Handle denormalized properties everywhere* (#5635)
* WIP: port process_math to support materialized columns

* Add skipped test showing trend breakdowns dont use materialized columns

* Simplify testing and test&fix math property aggregation w/ materialized columns

* Add (failing) test for filtering with materialized action props

* Add test around materialized property filtering

* Refactor entity.math materialization impl

* Make trends breakdowns work with materialized columns

* Simplify process_math further

* Handle denormalized properties in format_action_filter for step.properties

Note the following files all called this method:
ee/clickhouse/views/events.py
ee/clickhouse/views/actions.py
ee/clickhouse/queries/trends/util.py
ee/clickhouse/queries/trends/lifecycle.py
ee/clickhouse/queries/trends/breakdown.py
ee/clickhouse/queries/funnels/base.py
ee/clickhouse/queries/sessions/util.py
ee/clickhouse/queries/clickhouse_stickiness.py
ee/clickhouse/queries/clickhouse_retention.py
ee/clickhouse/models/cohort.py

I verified all of them are OK since they query events table directly
with the passed filter

* Handle materialized $current_url in action step filtering

* Remove now unneeded clause

* Update test helper

* Allow denormalized props for filtering with breakdowns

* Allow denormalized props for filtering with lifecycle

* Allow denormalized props for some views

* Fix entity math yet again

* Query materialized columns in insights > sessions

* Handle breakdown edge case

* Allow denormalized props for more views

* PR feedback

* reformat
2021-08-19 16:09:40 +03:00
Karl-Aksel Puulmann
8b0b4bdf0f
Account for entity properties in stickiness feature (#5641)
Closes https://github.com/PostHog/posthog/issues/5639
2021-08-19 13:21:56 +02:00
Karl-Aksel Puulmann
0f0241e01d
Funnels: support breaking down by "All users" pseudo-cohort (#5651)
This already works in trends, but had a bug in funnels. Unified the
implementations as well.

Closes https://github.com/PostHog/posthog/issues/5566
2021-08-19 13:23:07 +03:00
Michael Matloka
d225d6ef8e
Add support for cohort-based cohorts (#5632)
* Add test cases for calculation of cohort-based cohorts

* Add cyclic dependency test

* Add support for cohort-based cohorts

* Reraise error in `calculate_people_ch` to fail loudly

* Use feedback

* Update `test_error_while_calculating`

* Move CH test case to CH suite

* Fix funnels and code formatting
2021-08-19 10:59:03 +02:00
Karl-Aksel Puulmann
44ca474897
Wrap client err before sending to statsd (#5649)
This makes statsd stats more useful on query errors
2021-08-19 10:54:34 +02:00
Karl-Aksel Puulmann
020cb3b085
Only query event columns that are needed (#5610)
* Cache action lookups on entity

* Avoid mutating filters

* Single-line a long query line

* Calculate columns to select from table dynamically

* Rename class to ColumnOptimizer

* Improve typing

* Set logic

* Rename var

* Fetch funnel top values via materialized columns

* Add a cast

* Simplify, fix

* Move types to more logical place

* Add tests for ColumnOptimizer

* Tidy code

* Test whether elements_chain is needed or not

* No caching in tests

* Use `ColumnOptimizer` in trends

* Prepend commas

* Fix event_query tests

* Handle another edge case around elements_chain

* Handle funnel exclusions

* Add documentation around trickier pieces of logic

* Comment out a broken case for now
2021-08-19 10:17:40 +03:00
Karl-Aksel Puulmann
59c7efdebe
Migrate person_distinct_id table to CollapsingMergeTree (#5563)
* WIP: Migration to migrate person_distinct_id to CollapsingMergeTree

* Improve migrations

* Another attempt at migration

Using nullable otherwise it defaults without the default 😅

* Linter approved

* Update test code

* Fix testing issues
2021-08-18 17:25:02 +03:00
Michael Matloka
49c8ec58b0
Add "KEEP CLICKHOUSE-SERVER VERSION IN SYNC" comment (#5623) 2021-08-17 21:54:47 +02:00
Eric Duong
c79c270f5f
Cumulative person bug (#5572)
* add test and only handle interval if it's non cumulative

* add cumulative to tests that have specific date range
2021-08-17 15:13:24 -04:00
Karl-Aksel Puulmann
4ba8249cb5
Handle materialized properties in more cases (#5523)
* Extract method from funnels code

* Add failing test case for using denormalized property in a funnel breakdown

* Handle materialized event properties in funnel breakdown

* Refactor property lookups

* Use denormalized properties in paths

* Update validation tests

* Update validation tests

* Fix a broken test

* Move test around
2021-08-17 12:30:28 +03:00
Karl-Aksel Puulmann
9a6516aa94
Use Literal type to type Filter/Property/Entity objects better (#5608)
* Type python Property.type

* Type Filter.breakdown_type in python

* Fix typing issue in actions view

* Type python Filter.insight

* Type python Filter.display

* Type python Filter.interval, fix resulting typing errors

* Type python funnel Filter.layout

* Type python funnel Filter.funnel_window_interval_unit

* Type python Filter.retention_type

* Type python funnel Filter.funnel_window_interval_unit_ch

* Type python path Filter.path_type

* Type python path Filter.target_event

* Type Entity.type

* Type python Property.operator
2021-08-17 12:13:14 +03:00
Karl-Aksel Puulmann
46f43bc247
Fix empty element filtering (#5504)
* Refactor event_query class

* Don't error when filtering by empty elements array

"Solves" https://github.com/PostHog/posthog/issues/5501

* Solve same copy-pasted solution consistently

* Behave consistently with return values

See also issue https://github.com/PostHog/posthog/issues/5503 - maybe we
shouldn't even allow non-empty?
2021-08-16 10:51:12 +03:00
Michael Matloka
18bd79ee41
Insights refresh improved (#5530)
* Improve insight refreshing UX

* Clean up

* Make sure `ComputationTimeAndRefresh` is on the right in Trends too

* Fix typing and some inconsistencies

* Remove unused const

* Update test_clickhouse_insights.py

* Update decorators.py

* Refactor `ComputationTimeWithRefresh` into own file
2021-08-13 03:31:54 +02:00
Eric Duong
27a8944413
Match docker compose file clickhouse version to cloud prod version (#5573)
* match docker compose file clickhouse version to cloud prod version

* trigger tests
2021-08-12 16:06:47 -04:00
Neil Kakkar
a245c15c94
Group reamining breakdown values into "Other" for funnels (#5538)
* breakdown grouping

* resolve pagination woes

* explain the offset override

* document assumption
2021-08-12 13:38:28 +00:00
Eric Duong
de7ff476c5
Allow cohort breakdown to show on funnel (#5495)
* allow cohort breakdown to show

* Sanitize `order` in `Entity.__init__`

* Remove kludge from #5485 by making `entity.order` useful in practice

* Use synthetic `index` instead of user-provided `order`

* Fix `processed_entities` sorting

* Update frontend/src/scenes/funnels/funnelLogic.ts

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>

* change type guard and add number back

* remove typeguard and add correct types for cohorts

* remove type change

* working cohort breakdowns ui

* one more type fix

* adjust tests

* adjust tests

* more test adjustmenet

* minor syntax change

* use breakdown type

* add comment

* remove leakover

Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
Co-authored-by: Sam Winslow <sammywinslow@gmail.com>
2021-08-11 13:56:49 -04:00
Michael Matloka
984cdd547d
Remove kludge from #5485 by using entity.index (#5497)
* Sanitize `order` in `Entity.__init__`

* Remove kludge from #5485 by making `entity.order` useful in practice

* Use synthetic `index` instead of user-provided `order`

* Fix `processed_entities` sorting

* Add `index` comment
2021-08-09 20:23:36 +00:00
Karl-Aksel Puulmann
3984ae2279
Handle person having no distinct_ids in events table (#5500)
Sentry error: https://sentry.io/organizations/posthog/issues/2297864788/?project=1899813&referrer=github_integration
Closes https://github.com/PostHog/posthog/issues/5385

Not 100% sure how this happens (race condition with user getting
identified?) but the same guard exists in the postgresql-based codebase.
2021-08-09 22:21:53 +03:00
Karl-Aksel Puulmann
41baed2594
Fix sentry metrics capture (#5513)
https://sentry.io/organizations/posthog/issues/2563780334/?project=1899813&referrer=slack
2021-08-09 15:43:34 +03:00
Karl-Aksel Puulmann
dac770ae45
Gather info on response codes in API (#5499)
Using that to add metrics to endpoints-based dashboard, making sure we
don't e.g. 400 too often. :)
2021-08-09 13:06:39 +01:00
Karl-Aksel Puulmann
a860da9e90
Dynamic materialized columns (#5458)
* Add migration marking existing columns as materialized with a comment

* Add method to allow looking up materialized columns

* Add test for fetching and creating materialized columns

* Disable caching in tests

* Remove some callsites to CLICKHOUSE_DENORMALIZED_PROPERTIES

* Fixup caching logic

* Add (currently broken) test for denormalizing person properties

* Update funnel event query to work with new functionality

* Update other tests/queries

* Remove now-unused setting
2021-08-09 10:11:36 +03:00
Eric Duong
f14ed0bb2b
Only replace top level distinct_id when formatting cohort subquery (#5493)
* only replace top level distinct_id

* type

* change name and type
2021-08-06 15:32:14 -04:00
Karl-Aksel Puulmann
f25ae0a879
Generate clickhouse query error class dynamically (#5492)
This helps with not grouping sentry errors together.

See issue for more context

Closes https://github.com/PostHog/posthog/issues/5491
2021-08-06 16:31:42 +01:00
Karl-Aksel Puulmann
baa89a1386
Sanitize entity.math_property (#5485)
* Sanitize `entity.math_property`

Was refactoring related code and stumbled upon this issue. Yikes!

* WIP

* Improve breakdowns
2021-08-06 17:43:21 +03:00
Michael Matloka
c2bc2fecd0
Use proper interval calculation in the funnel trends query (#5467)
* Use proper interval calculation in the funnel trends query

* Add some comments

* Update `test_filter`

* Rework `NULL_SQL` to use CH `INTERVAL` too

* Fix week-based relative `date_from` support not existing

* Make use of `toInterval*` functions and inject less

* Add fallback for `date_from` in `ClickhouseSessionsAvg`
2021-08-06 11:29:35 +02:00
Karl-Aksel Puulmann
a1dd96e47d
Improve cached_property typing (#5465)
* Improve cached_property typing

Noticed that e.g. `filter.breakdown` was getting inferred to be `Any`
which is not correct. Added generics to fix it :)

* Proposed fix: make filter_test_accounts return a bool always

* Fix warning in clickhouse_sessions.py

* Cast in session.events

* Cast 2x in funnel queries

* Ignore error in session recording

We know the valid values here

* Add assertions in stickiness filters

* Cast in more funnel queries

* Untyped dict where inferred type is wrong

* Add types to abstract methods

* Type prop_vals

* Add a lot of casts

These are correct. We should really validate while parsing instead

* Add more casts to funnel trends

* Last fixes
2021-08-05 22:31:31 +03:00
Karl-Aksel Puulmann
4260cc868f
Make timer safe (#5469)
Supercedes https://github.com/PostHog/posthog/pull/5468
2021-08-05 16:58:21 +03:00
Karl-Aksel Puulmann
bc49811e06
Update query metrics (#5460)
Previous change made it really hard to calculate failure %, fixing...
2021-08-05 13:12:52 +03:00
Michael Matloka
e48bd8b08b
Allow "new member" email opt-out (#5430) 2021-08-04 18:09:41 -07:00
Karl-Aksel Puulmann
d4f246ecab
Make breakdowns + formulas work (#5444)
* Use f-strings in trends/formula

* Make formulas and breakdowns work

Closes issue https://github.com/PostHog/posthog/issues/5390

Previously the query returned a 500 for some breakdowns, with the error
`Arrays passed to arrayMap must have equal size: while executing 'FUNCTION arrayMap`

The issue came from the different subqueries having different breakdowns
- some would break down with values A and B and other would have B and C

After the full outer join, arrays for breakdown values A and C would be empty in some cases. Filling them with zeroes fixes the issue.
2021-08-04 19:32:00 +03:00
Eric Duong
24a708c259
Funnel trends all date range (#5420)
* implementation and test

* change to escape params
2021-08-04 10:33:39 -04:00
Karl-Aksel Puulmann
d25fa2c2d5
Fix "filter test accounts via cohort" filter (#5442)
Closes https://github.com/PostHog/posthog/issues/5441
2021-08-04 11:44:45 +01:00
Neil Kakkar
5d3eb59807
Update default breakdown limit in funnels (#5426)
* Update default breakdown limit in funnels

https://github.com/PostHog/posthog/issues/5341#issuecomment-891743574

* update test

* add default to breakdown limit property

* address comments
2021-08-03 14:18:20 +01:00
Karl-Aksel Puulmann
2940dfee96
Fix "ambigious column distinct_id" (#5423)
* Fix "ambigious column distinct_id"

The problem came in a trends query:
1. Which filters by action having person property filters
2. The overall query having a person property filter

See also the regression test

Closes https://github.com/PostHog/posthog/issues/5388

* Add calculate_events call
2021-08-03 11:55:02 +01:00
Neil Kakkar
a5d9953dc1
Make Breakdown limit customizable and Allow empty breakdown value in trends and funnels (#5357)
* breakdown limits update

* include null in limit

* clean breakdowns for trends & peeps
2021-08-03 10:59:09 +01:00
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
Eric Duong
63c57dc5b4
comment out test (#5364) 2021-07-28 23:24:32 +00: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
Alex Gyujin Kim
f9cd157ca8
Revert "Fix CH no data blocker (#5238)" (#5239)
This reverts commit babf93b413.
2021-07-21 06:38:08 +00:00
Alex Gyujin Kim
babf93b413
Fix CH no data blocker (#5238) 2021-07-21 05:23:35 +00: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
Sam Winslow
60cbf2e7c1
Trigram fuzzy search for property definitions (#5039)
* Trigram fuzzy search for property definitions

* support empty search param

* Only use pg_trgm search if pg extension is installed

* suppress exceptions if migration does not succeed

* checks for index

* troubleshooting

* wip: change migration number; strip out conditionals

* wip: copy code from #4110

* remove is_pg_trgm_installed

* try ngram search on CH

* add AND before ngram

* correct some check failures

* remove ordering

* remove ordering from tests

* fix ordering

* rewrite queries for psql, add test bypass for EE features

* remove ordering filter bc of bugs

* remove test code

* check if isinstance of RawQuerySet

* cleanup sql

* add ordering

* typing

* test for ee prop definition

* adjustments to test_ee_property_definition

* add test_ee_event_definition

* restore this prop

* convert to simple term filter

* use term search in EE

* fix EE tests

* fix non-EE tests

* fix test

* fix filter types

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-07-20 14:58:16 +02: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
Karl-Aksel Puulmann
11ede28a08
Default to "posthog" cluster (#5164)
As-is this default hurts local dev - one more setting you need to
export. Let's keep the setup simple instead.

Also the new default would have broken helm chart and production
when updating with new migrations - the cluster name there is `posthog`
for both it seems.

Let's force other deploys to be explicit instead.
2021-07-16 17:04:15 +03:00
Karl-Aksel Puulmann
96ad4a6d32
Fix build (#5162)
* Test: Update requirements

* Update version

* Attempt #3
2021-07-16 16:21:36 +03: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
Marius Andra
96720e51bd
remove 5439 and restore sanity (5432) (#5128) 2021-07-14 17:14:27 +02: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
Michael Matloka
a599056234
Handle Action.DoesNotExist more (#5028)
* Handle `Action.DoesNotExist` more

* Reuse try-except logic for `Action.DoesNotExist`

* Fix circular import

* Add `test_funnel_invalid_action_handled`
2021-07-08 21:47:14 +00: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
d12b09f89e
Improve time to convert binning behavior, add autobinning, expose in API (#4995)
* Improve time to convert binning behavior, add autobinning

* Test and fix custom bin count

* Expose `ClickhouseFunnelTimeToConvert` in the API

* Revert a column name change

* Fix `bin_count` clamping

* Add an API test for viz type `time_to_convert`

* Update SQL comments

* Remove some unused imports

* Fix `FunnelTypeMixin.funnel_viz_type`

* Remove `DEBUG=1`
2021-07-08 17:51:13 +02:00
Karl-Aksel Puulmann
714697467c
Load action matching event count async (#5027)
* Load action event count asynchronously

This speeds up loading/editing events quite a bit on clickhouse.

Issue: https://github.com/PostHog/posthog/issues/4802

* Add test for /api/action/{id}/count endpoint

* Update code
2021-07-08 15:14:14 +03:00
Eric Duong
d5e3bb6475
Replace old funnel step logic (#4923)
* swap out new logic

* remove test

* add other funnel types to insight api

* bring back funnel queries

* add test back
2021-07-07 14:56:19 -04:00
Eric Duong
6e611050aa
Add person select to new funnel query for backwards compatibility (#5019)
* add person select so that we can parse and make api backwards compatible

* move function

* uncomment tests
2021-07-07 13:30:00 -04:00
Neil Kakkar
7d5e8a7e30
Step time conversions for Unordered funnels (#5024)
* initial attempt to figure out unordered time conversions

* setup unordered funnel conversion times

* cleanup
2021-07-07 15:18:27 +00:00
Eric Duong
ef0f9afc03
add missin funnel trends param (#5015) 2021-07-06 14:51:15 -04:00
Eric Duong
708dcbbdf5
Funnel steps breakdown (#4949)
* move breakdown logic to separate class

* working breakdown without limits

* add limit logic

* remove print

* arr to dict

* tests

* fix test

* fix tests

* make suggested change

* remove one of the changes

* addjust again

* make funcs pure

* add limit
2021-07-06 12:37:10 -04:00
Michael Matloka
d655ca7c8d
Fix some insights query building 500s (#4971)
* Fix handling of cohort without match groups

* Fix bug with CH precalculated cohort query building

* Fix `get_person_ids_by_cohort_id`
2021-07-05 11:49:55 +02:00
Michael Matloka
64a7f0fb8e
Fix funnel trends backwards compatibility (#4978)
* Fix funnel trends backwards compatibility

* Don't set funnel_viz_type outside of funnel insight filters

* Reorder conditions for clarity and use null check
2021-07-02 14:26:21 +00:00
Karl-Aksel Puulmann
d899ea8373
Return a 512 error if query would be estimated to time out (#4973) 2021-07-02 13:35:18 +03:00
Neil Kakkar
22e02537c4
Setup Funnel Option Type, and proper Funnel[Persons] API routes (#4946)
* setup funnel option type, and proper API for persons and usual funnel routes

* update tests, fix bugs

* make insights compulsory

* nvm

* remove insights key

* fix person caching

* revert problems, fix typings

* address comments

* dont use defaults in mixins

* typing

* cleanup and fix TODOs

* update test

* adapt api to 4957

Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 14:43:44 -04: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
Michael Matloka
a5cc8d36df
Handle cohort being filtered on not existing (#4961)
* Raise 400 instead of 500 if filter cohort does not exist

* Actually return empty 200 results instead of 400

Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 13:30:18 -04:00
Neil Kakkar
a5b7b31827
Funnel with Strict Step Ordering (#4890)
* 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

* add strict option for funnels

* typing

* use new persons pattern

* persons for funnel strict ordering

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 13:14:40 -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
Karl-Aksel Puulmann
ec5d839337
Proposal: Use ValidationError over ValueError in views (#4917)
* Proposal: Use `ValidationError` over `ValueError` in views

This generates a nicer exception for our users (400 response instead of
500) and we cut down on 500 errors for things that are not expected to
work.

* Capitalization

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-07-01 18:48:09 +03:00
Li Yi Yu
ed2f9ce47e
Make funnel persons api call return values structure consistent with others (#4957)
* make funnel persons api call return values consistent with others

* update for regular funnels

* update tests

* black

* fix tests

* test fix

* fix tests

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2021-07-01 10:04:40 -04:00
Karl-Aksel Puulmann
06884e0e1c
Speed up /api/person/properties under clickhouse (#4940)
For our largest teams this currently times out on postgres. Tested and
this query works well on clickhouse.

Sentry issue: https://sentry.io/organizations/posthog/issues/1724065650/events/a038f0a1624e4e68bd47142731f26018/?project=1899813&statsPeriod=14d
2021-07-01 12:31:23 +03:00
Michael Matloka
662e979367
Ignore breakdown in funnel trends (#4948) 2021-06-30 17:36:51 +02:00
Neil Kakkar
28d87acc27
Funnel Unordered Steps (#4868)
* 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

* address comments

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-06-30 14:01:59 +02:00
Li Yi Yu
20a0ceabf5
Persons modal filtering (#4839)
* open person link in new tab

* set up filtering for person modal

* leave basic search with fuse

* allow for property filtering

* clean up UI

* linter

* replace fuse with backend querying because of pagination issues

* lint

* cohort test failure fix

* prettier

* fix bug

* do not open new persons tab

* return unique persons

* reuse filter request method for persons modal search

* fix test and linter failures

* isort

* feature flag it

* don't disappoint mypy

* try to separate persons modal logic

* cleanup component and logic code

* try to make types happy

* more type fixing

* fix count bug

* more fixes

* type with session string instead of string

* sanitize url param

* add or session back

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-06-30 12:25:45 +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
Eric Duong
38988f7ddb
added test for default (#4930) 2021-06-29 19:14:21 -04:00
Karl-Aksel Puulmann
b6f8568f8f
Only send error class name to statsd (#4902)
This seems to have caused some errors in sentry:
- https://sentry.io/organizations/posthog/issues/2476537458/?project=1899813&query=is%3Aunassigned+is%3Aunresolved&statsPeriod=14d
- https://sentry.io/organizations/posthog/issues/2476551877/?project=1899813&query=is%3Aunassigned+is%3Aunresolved&statsPeriod=14d

Given we don't need the whole error message in sentry this might be
enough :)
2021-06-29 23:50:29 +02:00
Eric Duong
7c36769f95
add default to funnel window (#4928) 2021-06-29 17:45:51 -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
afd2a3e6d0
change result shape (#4926) 2021-06-29 17:23:35 -04:00
Karl-Aksel Puulmann
7f33dcd9cb
Don't error if trying to filter by person_id which does not exist (#4916)
Sentry error: https://sentry.io/organizations/posthog/issues/2240057229/?project=1899813&query=is%3Aunassigned+is%3Aunresolved
2021-06-29 19:30:34 +02:00
Eric Duong
562e3bacfc
Funnel persons per step and dropoff (#4883)
* 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

* add ability to specify per step or dropoff persons

* remove defaults

* remove funnel_window parameter unless it's needed

* add param to filters

* test api

* remove print

* fix tests

* change distribution

* add none condition for funnel step

* add order by

* remove funnel window days

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2021-06-29 12:22:42 -04: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
Eric Duong
ebea9abad4
Funnel steps conversion time per step (#4892)
* change result set and calculate avg conversion time

* remove people var
2021-06-29 11:16:03 -04:00
Alex Gyujin Kim
d36b15ed0e
Add frontend local dev script for Clickhouse development (#4891)
* add frontend dev script

* some refactoring
2021-06-28 23:02:13 -07: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
489a77646f
Generate local tests cases (#4874)
* added many cases and changed dates so that we can write better tests

* corrected tests
2021-06-25 12:38:04 -04:00
Tim Glaser
845117cd8e
Fix people csv download (#4804)
* Fix downloading person CSV in clickhouse

* add properties

* Fix exceptions

* add properties
2021-06-24 17:12:04 +02:00
Li Yi Yu
24fd3a54ff
Event definition drawer properties (#4722)
* wrap css classnames and allow for property definition filtering

* event properties section

* properties stats table and object tag functionality

* property descriptions and save all descriptions button

* fix description editing on the table

* fix test failures

* debouncing input is weird

* split up components

* refactor definition drawer kea file

* drawer should only open for taxonomy feature users

* lint errors

* prettier

* property definition filter backend test

* fix test

* populate test with definitions..

* clean up

* clean up property drawer interactions

* fix everything but scroll top issue

* test scroll issue

* table state wip

* update logic after typegen

* prevent undefined error

* only make the clickable rows clickable, not the entire table

* upgrade typegen and fix error with feature flags

* move to reducers and rename action

* update blacklist

* fix event properties description bug

* update typegen once more

* fix editing for events table

* fix editing for properties table

* add script to clean typegen

* update ts blacklist

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-06-24 09:00:59 +02: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
Eric Duong
d31220e85d
Make event query class inheritable (#4720)
* make query class inheritable

* swap out class

* move trend event query to separate file and replace date_filter func

* prune imports and fix test

* add type

* remove imports
2021-06-22 11:44:55 -04:00
Marius Andra
3c691f4f5c
Funnels API GET -> POST|GET - Frontend + Clickhouse (#4789)
* Revert "Revert "[Frontend Change] Funnels API GET -> POST|GET (#4769)" (#4777)"

This reverts commit dab41f0f6a.

* Add POST support to clickhouse funnels

* run funnel tests on clickhouse
2021-06-21 13:13:08 -07:00
Michael Matloka
5394533bde
Don't fire webhooks and Zapier in case of PLUGIN_SERVER_ACTION_MATCHING (#4794)
* Don't fire webhooks and Zapier in case of PLUGIN_SERVER_ACTION_MATCHING

* Add PLUGIN_SERVER_ACTION_MATCHING to settings

* Add PLUGIN_SERVER_ACTION_MATCHING to ECS task defs

* Remove leftover print

* Update `AsyncActionMappingNotice`

* Remove stale import
2021-06-18 16:32:29 +02:00
Tim Glaser
b821b845a6
Remove free clickhouse license (#4788) 2021-06-17 16:47:04 +03:00
Alex Gyujin Kim
ba8c387897
[Backend Change] Funnels API GET -> POST|GET (#4768)
* change get to post api

* tests

* fixed bug

* isort

* make funnels endpoint backwards compatible, add test to check this

* descriptive comment

* revert funnelLogic to current

* revert code removed in error

Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro-2.local>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-06-16 10:07:29 +02:00
Karthikeyan Singaravelan
7e20186064
Fix deprecation warnings due to invalid escape sequences. (#4633) 2021-06-15 11:41:49 +02:00
Li Yi Yu
2aa1edc5cd
Add limit to clickhouse sql events (#4740)
* add limit to clickhouse sql event

* fix limit sql string

* added test for limit parameter

Co-authored-by: Buddy Williams <buddy@posthog.com>
2021-06-14 17:04:00 -04:00
Tim Glaser
1da9084e83
Closes #4679 fix deleting persons (#4734) 2021-06-14 10:17:38 -04:00
Eric Duong
bb9b6b42f2
Engagement cohorts (#4510)
* add migration

* add fields

* remove comment

* change to is_deleted

* Update migration to work

* Update tests

* initial functions

* fix params

* add migration

* add named param

* working test

* update person prop and cohort tests

* use var

* move sql and fstring

* remove get inside django signal

* just create the table

* add replication logic

* add param

* change replacing name

* refactor and add event based cohorts

* add type

* add to model

* add test for event_id

* move sql

* add sql

* make sure actions work too and add test

* add ability to create cohort by event count

* glob match cypress cache

* fix type

* fix type

* refactor and add datetime support

* fix ordering issue in test

* add timestamp test

* fix type

* fix more types

* use var resolution

* add operators

* add necessary filter and test

* add call for calculating cohort on create

* add triggers to oncreate and onupdate

* breakup test and remove repeated subquery

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2021-06-11 13:59:57 -04:00
Eric Duong
f6156c3bd6
Breakdown value display people params (#4640)
* add type

* add test

* use camelCase

* update test
2021-06-11 13:57:03 -04:00
Eric Duong
946435a752
Revert "Change funnels API from GET to POST|GET (#4670)" (#4702)
This reverts commit 4a8151bd4e.
2021-06-10 17:03:20 -04:00
Eric Duong
3fe1d29ca6
Event query class (#4649)
* first try

* add entity query

* fix type issues

* used in trends

* fix test

* change select format

* change var

* add cohort filter

* add cohort conditions

* change pdi to distinct_ids
2021-06-10 14:47:33 -04:00
Alex Gyujin Kim
4a8151bd4e
Change funnels API from GET to POST|GET (#4670)
* change get to post api

* tests

* fixed bug

* isort

* make funnels endpoint backwards compatible, add test to check this

* descriptive comment

Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro-2.local>
2021-06-10 16:09:30 +02:00
Li Yi Yu
6f6b126f22
Event/property taxonomy frontend (1/3) (#4591)
* split up files and organize code

* set up definition drawer and logic and add tagging

* add change owner selection

* definition description editing working

* definition drawer graph and events table

* remove graph logic for now

* small fixes

* property definition doesn't have an owner

* minor tweaks

* lots of small fixes

* show tags on table, disable editing for posthog events, fix tags autocomplete

* fix font sizes and alignment

* allow event limiting and hide behind feature flag again

* linter things

* test fix

* lint

* clean up events limit

* limitOffsetPagination in events

* ignore type

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-06-09 19:45:42 -04:00
Alex Gyujin Kim
50e1241049
Revert "Change funnels API from GET to POST (#4602)" (#4645)
This reverts commit b87f79dd41.
2021-06-08 19:08:53 +00:00
Alex Gyujin Kim
b87f79dd41
Change funnels API from GET to POST (#4602)
* change get to post api

* tests

* fixed bug

* isort

Co-authored-by: Alex Kim <alexgkim205@gmail.com>
2021-06-08 11:20:47 -07:00
Eric Duong
8cc90dff67
make sure to add table name to prop clauses on breakdown query (#4607)
* make sure to add table name to prop clauses so that event/person properties column isn't vague

* pass table name when formatting breakdown query

* add test
2021-06-08 13:45:55 -04:00
Eric Duong
16f3d8caea
Make sure event prop breakdowns return correct people (#4638)
* make sure event prop breakdowns return correct people

* add clause to postgres

* fix test
2021-06-08 10:57:48 -04:00
Eric Duong
3eeb770e0b
Use cohortpeople table for queries (#4622)
* use cohortpeople table for queries

* add check

* make sure timestampe is offset aware
2021-06-07 19:16:03 -04:00
Eric Duong
ff43c9f0aa
Collapsing table cohortpeople (#4428)
* add migration

* add fields

* remove comment

* change to is_deleted

* Update migration to work

* Update tests

* initial functions

* fix params

* add migration

* add named param

* working test

* update person prop and cohort tests

* use var

* move sql and fstring

* remove get inside django signal

* just create the table

* add replication logic

* add param

* change replacing name

* make sure actions work too and add test

* add necessary filter and test

* add triggers to oncreate and onupdate

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2021-06-07 10:16:21 -04:00
Eric Duong
009119eb1b
add migration that migrates the table again without sharding (#4604) 2021-06-07 11:39:30 +03:00
Buddy Williams
7d045c86f3
Refactoring funnel trends (#4419)
* checkpoint: refactoring funnel trends so that they work correctly

* wip: refactoring funnel trends query to return the results we actually need

* wip: added in new query for testing

* wip: moved sql into a separate file, converted list to dictionary, and added several tests to check data quality

* wip: with a better understaning of funnel trends I've refactored the query so that I can write a data transformer in python

* moved code into funnel_trends for both logic and tests to isolate the concern

* reordered methods for readability

* wip: refactoring funnel trends to support filters

* wip: added updated SQL which will replace the existing FUNNEL_TREND_SQL

* correct column name so that it's clearer

* added substitution variables to new query

* fixed missing substitution variable

* wip: integrating new query with correct params, added mixins for funnel_window, and working toward working test

* several query corrections

* summarize funnel trends

* moved method down

* removed unused code

* added data quality checks

* corrected cohort size for tests

* test window size and incomplete status

* corrected a few names

* removed unnecessary comment

* commented out old funnel trends tests

* removed print statement

* removed old funnel trend code

* made funnel trends response match existing data structure layout

* removed unused imports

* removed more unused imports

* fixed mypy errors

* Added ClickhouseFunnelBase to extract common methods for both ClickhouseFunnelTrends and ClickhouseFunnel; this also fixes issues with tests;

* removed unused type comment

* corrected test to account for new funnel_window_days mixin

* fixed clickhouse funnel tests

* fixes for automated tests

* changed team_id to use client substitution to avoid sql injection attempts in the future but since it's not user supplied it's not currently an issue

* corrections prompted by PR review

* corrected test to dict test with funnel_window_days
2021-06-03 17:06:08 -04:00
Eric Duong
dd0175c1a6
add stickiness test account filter for clickhouse and test (#4221) 2021-06-03 15:59:05 -04:00
Li Yi Yu
7546e3ea0a
Event properties taxonomy (#4486)
* add description and tag fields to event and property definitions

* set up description and tagging on models

* frontend functionality for description editing

* connect backend and kea logic for description editing

* update event and property definitions model and migration

* delete set null instead of cascade

* migration merge fix

* add owner column

* undo posthog event property taxonomy migrations

* set up definitions on enterprise level

* allow enterprise definitions description editing

* fix licensing conditions and add tests

* proper get and update methods for the multi inheritance table and new column fields for enterprise event model

* check for license to separate routes

* migrate existing definitions to ee definitions tables and render ee vs non-ee definition views based on existing feature conditional

* all the working backend updates

* updated tests

* frontend fixes and linting updates

* feature flag it
2021-06-03 09:22:16 -04:00
Michael Matloka
8ef727634e
Syncing action definition changes with plugin server (#4436)
* Save Organization.available_features as a DB column

* `update_available_features()` before an organization is created too

* Run the task half past the hour

* Adjust tests and fix available_features sync on start

* Improve action and property TS types

* Use plugin server ActionManager pubsub

* Use better pubsub channel names for plugin server ActionManager

* Fix PubSub's lack of teamId

* Use f-strings for property CH SQL formatting
2021-05-31 11:10:36 +02:00