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

71 Commits

Author SHA1 Message Date
Eric Duong
be9c9c0119
chore(cohorts): directly filter on version of cohort (#15005)
* directly filter on version of cohort

* fix typing

* Update query snapshots

* Update query snapshots

* Update query snapshots

* type mismatch

* type mismatch

* Update query snapshots

* fix tests

* make sure count is calculating based on latest version

* Update query snapshots

* Update query snapshots

* Update query snapshots

* change count back

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-12 11:58:37 -04:00
Yakko Majuri
06d90c35f0
refactor(poe): using_person_on_events -> person_on_events_mode (#14792)
* initial team attr, PersonPropertiesMode refactor

* using_person_on_events -> person_on_events_mode

* fix person_properties_mode signatures, format

* add comment to team

* missing refs

* fix enum

* Update ee/clickhouse/queries/funnels/funnel_correlation.py

* Update ee/clickhouse/queries/funnels/funnel_correlation.py

* fix

* fix

* more fixes

* fix circular import

* add settings

* Update query snapshots

* Update query snapshots

* to enum or not to enum

* Update query snapshots

* Update query snapshots

* Update posthog/queries/trends/trends_event_query_base.py

* Update posthog/test/test_team.py

* Update posthog/queries/foss_cohort_query.py

* Update posthog/queries/foss_cohort_query.py

* Update posthog/queries/foss_cohort_query.py

* Update query snapshots

* Update query snapshots

* more and more fixes

* black

* code quality

* Update query snapshots

* Update query snapshots

* Update posthog/queries/session_recordings/session_recording_list.py

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* Update posthog/queries/paths/paths_event_query.py

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* fixes

* argh

* Update query snapshots

* fix test

* fix hogql

* Update posthog/queries/stickiness/stickiness_event_query.py

* fix breakdown

* Update query snapshots

* Update query snapshots

* Update query snapshots

* fix another test

* update base num queries due to extra instance config lookup for poe v2

* black

* sort

* assert num queries test

* Revert "assert num queries test"

This reverts commit c48c7fccf7.

* revert v2 enabled flag as theres no need for it now

* Update query snapshots

* Revert "update base num queries due to extra instance config lookup for poe v2"

This reverts commit 644e9b2658.

* Update query snapshots

* come on its friday lets get greeeeen

* the saga continues

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tiina Turban <tiina303@gmail.com>
2023-03-20 12:03:36 -03:00
Marius Andra
00f98214a6
feat(hogql): custom virtual database per team (#14740) 2023-03-17 10:49:17 +01:00
Tomás Farías Santana
315f47f57d
feat: person-overrides writes with Mapping to Persons (#14513)
* feat(person-override): Add a helper model to indirectly reference person overrides

This allows us to use an exclusion constraint on the person overrides table instead of directly using a FK on posthog_person.

* test(person-overrides): Update tests to match new constraint

* fix(migration): Add drop extension query to reverse migration

* fix(migration): Use correct table name

* refactor(person-overrides): Make team a regular bigint field without FK

* refactor(person-overrides): Rename Helper model to Mapping

* feat(person-override): Add a helper model to indirectly reference person overrides

This allows us to use an exclusion constraint on the person overrides table instead of directly using a FK on posthog_person.

* wip: add test for concurrent updates to posthog_personoverride table

* refactor

* Update snapshots

* fix(isort): Correctly sort imports

* fix(ee-cohort-test): Delete person after creating it

* fix: person constraint in person overrides table (#14319)

* nits

* fix migration tests

* chore(migration): Bump migration number to 0302

* Update snapshots

* feat: person-overrides writes

* test(person-overrides): Add concurrent tests to person-overrides model

* feat(person-merge): Update merge to use new helper table

* fix(tests): Pass poEEmbraceJoin to updatePersonState in test

* fix(person-state): Format person-overrides message for ClickHouse

* test(api): Add function to reload dictionary for person overrides

* fix: poe final test failure

* refactor(person-state): Make failed attempts a class variable to

This allows us to mock it during testing as some tests require
immediate failures.

* fix(postgres-utils): Apply some magic changes lost to time

* fix(person-state): Join with helper table to return UUIDs

* fix(person-state): Use single quotes for UUID queries

* test(person-overrides): Skip test that doesn't work without a merge command

* test(person-state): Add a very complicated query to get UUIDs in a test

* test(person-state): Try waiting longer, this is flaky

* fix(migrations): Remove unused migration

* fix(person): Undo unneeded person model changes

* chore: Clean-up artifacts from rebase on model branch

* refactor(person-state): Rename mergeAttempts and don't read from ENV

* chore: Better clarify oldest_event usage in comment

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* refactor(person-state): Update version in queries

* fix(person-state): Use new mapping model instead of helper

* fix(migrations): Re-add constraint deleted on field drop

* revert: Re-enable test that was skipped

Test was originally skipped due to missing a $merge command, but now
$merge_dangerously is available, so the test should pass.

* test: Attempt to refresh dictionary in test

* Update query snapshots

* Update query snapshots

* test: Expect dictionaries to be refreshed before resuming test

* fix(test): Use alias property for $merge_dangerously in test

* fix(test): Expect any string like in all other tests

* test: Fix order of events to determine merged persons

* chore: Update comment regarding overrides mapping query

* chore: Remove out of date comment

* test: Set number of retries to 0 when updating persons

* test: Delete comment

* test: Assert clickhouse state after identify

* chore: Move comment

* chore: Delete TODO regarding oldest_event updates

* test: Assert events are still processed if merge fails

* test: Assert properties are processed if merge fails

* test: Don't expect to throw when failing merges

* fix: Indent RETURNING query clause

Co-authored-by: Harry Waye <harry@posthog.com>

* chore: Remove out of date comment

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* test: Resume merges after test suite

* test: Run processPersonStep tests for both poEEmbraceJoin modes

---------

Co-authored-by: Harry Waye <harry@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tiina Turban <tiina303@gmail.com>
2023-03-13 11:52:08 +01:00
Tiina Turban
c6b70c6c38
revert: "fix(person-overrides): add constraints to catch race conditions" (#14445) 2023-02-28 16:48:52 +01:00
Harry Waye
1535170b0a
fix(person-overrides): add constraints to catch race conditions (#14277)
Co-authored-by: Tomás Farías Santana <tomas@tomasfarias.dev>
Co-authored-by: Tiina Turban <tiina303@gmail.com>
2023-02-28 14:30:40 +01:00
Neil Kakkar
8d05dee1aa
feat(cohorts): Remove postgres calculations for flags (#14272) 2023-02-28 13:03:48 +00:00
Marius Andra
5b4a3bffb4
feat(data-exploration): HogQL filters again (#13830) 2023-01-31 14:57:10 +01:00
Yakko Majuri
7bd5574861
fix(queries): explicitly prepend table person_id comes from in cohort queries with pdi joins (#13781)
* fix(queries): explicitly prepend table person_id comes from in cohort queries with pdi joins

* Update snapshots

* another test

* Update snapshots

* Update snapshots

* Update snapshots

* another try

* fixes

* Update snapshots

* trigger new test run

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-20 11:25:18 -03:00
Neil Kakkar
faf6d1e7ea
fix(cohorts): Handle negations for behavioural filters (#13478) 2022-12-23 12:14:21 +00:00
Neil Kakkar
4d386f2445
fix(cohorts): Handle negated cohorts everywhere (#13468) 2022-12-22 16:52:12 +00:00
Michael Matloka
cd1eda0bc4
refactor: Make persons- and groups-on-events var names accurate (#13266) 2022-12-12 15:08:31 +02:00
Michael Matloka
5d2ad6c7bb
chore(deps): Update black to 22.8.0 (#11596)
* chore(deps): Update `black` to `22.8.0`

* Format
2022-09-05 14:38:54 +02:00
Eric Duong
99db479c90
fix(cohort): make cohort recalculation simpler (#11335)
* fix: don't subquery when unnecessary

* fix test

* try replacing

* try simpler query

* replace for now

* use single query remove subquery changes

* remove test

* remove props

* fix return

* Update snapshots

* Update snapshots

* refactor

* Update snapshots

* Update snapshots

* fix unwrapping

* Update snapshots

* Update snapshots

* fix false condition

* Update snapshots

* Update snapshots

* restore _timestamp

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* update snapshot

* add snapshot test

* remove replace

* Update snapshots

Co-authored-by: EDsCODE <EDsCODE@users.noreply.github.com>
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2022-08-23 22:14:41 -04:00
Guido Iaquinti
c51b08b946
fix(misc): remove variable allocation when not needed (part #3) (#10508)
* fix(misc): remove variable allocation when not needed (part #3)

* fix(misc): remove variable allocation when not needed (part #3)
2022-06-27 19:26:09 +02:00
Eric Duong
89f612f84e
refactor: foss property util (#10318)
* refactor: foss move properties to /posthog

* refactor: move file
2022-06-17 09:31:54 -04:00
Eric Duong
e8d4d6d49d
refactor(foss): move all /sql queries (#10230)
* refactor: move prop value and actorbasequery files

* refactor: move test base

* fix: imports

* move middleware

* refactor: move cohort model util

* refactor: move all /sql queries

* fix: imports

* fix imports

* refactor: move cohort model util (#10224)
2022-06-13 18:05:14 -04:00
Eric Duong
ce7988ecfa
refactor: move prop value and actorbasequery files (#10258)
* Revert "fix: revert "move prop value and actorbasequery files" due to flaky test (#10257)"

This reverts commit ac1a485cdf.

* chore: empty
2022-06-13 16:24:14 -04:00
Eric Duong
ac1a485cdf
fix: revert "move prop value and actorbasequery files" due to flaky test (#10257)
* Revert "refactor: move prop value and actorbasequery files (#10220)"

This reverts commit 12bf3a7c3e.

* chore: empty
2022-06-10 23:49:53 +00:00
Eric Duong
12bf3a7c3e
refactor: move prop value and actorbasequery files (#10220)
* refactor: move prop value and actorbasequery files

* refactor: move test base

* fix: imports

* move middleware

* refactor: move cohort model util (#10224)
2022-06-10 18:44:50 -04:00
Eric Duong
c0ccc1fef8
fix: cohort update to original bug 2 (#10130)
* fix: add test for updating back to original

* fix: add test for updating back to original

* add uuid column to cohortpeople

* Update snapshots

* add migration

* remove random uuid

* Update snapshots

* add recalculation condition

* fix: tests working

* adjust tests

* add swapover test

* wrong var

* wrong param

* remove default

* Update snapshots

* Update snapshots

* refactor: sql

* accepted tables in test

* update tests

* don't alias otherwise condition is misled

* use more inclusive operator

* address comments

* fix: use column solution

* fix: group by version

* fix: add sort key modification

* fix: add comma

* Update snapshots

* Update snapshots

* update snapshots

* remove leftover

* remove stale test

* update snapshots

* add comment

* add test

* add version to count clause

* Update snapshots

* Update snapshots

Co-authored-by: Rick Marron <rcmarron@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-07 14:36:28 -04:00
Neil Kakkar
50ab936a06
fix(cohorts): Fix person on events tests (#10106)
* fix(cohorts): Fix person on events tests

* better test
2022-06-01 14:03:25 -04:00
Eric Duong
5b789f2210
chore: release new cohort query backend (#10049)
* Revert "chore: revert release new cohort query backend (#10024)"

This reverts commit cfaf942739.

* chore: empty
2022-05-31 10:39:30 -04:00
Eric Duong
cfaf942739
chore: revert release new cohort query backend (#10024)
* Revert "chore: release new cohort query backend (#10003)"

This reverts commit 1632c436af.

* chore: empty
2022-05-26 20:13:28 +00:00
Eric Duong
1632c436af
chore: release new cohort query backend (#10003)
* release: new cohort query backend

* chore: deep prune

* Update snapshots

* don't remove override test

* Update snapshots

* Update snapshots

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-26 12:34:47 -04:00
Neil Kakkar
45c4d7a98e
fix(cohorts): Fix outstanding cohort query bugs (#9675) 2022-05-09 11:16:55 +01:00
Neil Kakkar
b18d2bca7a
chore(cohorts): Add acceptance criteria for new cohorts and feature flag functionality (#9624)
* Revert "chore(cohorts): Revert Add acceptance criteria for new cohorts and feature flag functionality (#9623)"

This reverts commit 8e277ee237.

* better defaults for old cohorts that dont quite work
2022-05-03 17:09:24 +01:00
Eric Duong
8e277ee237
chore(cohorts): Revert Add acceptance criteria for new cohorts and feature flag functionality (#9623)
* Revert "chore(cohorts): Add acceptance criteria for new cohorts and feature flag functionality (#9594)"

This reverts commit 2b86c61a6d.

* fix: revert
2022-05-03 11:10:59 -04:00
Eric Duong
2b86c61a6d
chore(cohorts): Add acceptance criteria for new cohorts and feature flag functionality (#9594)
* add fields to property

* add validatoin

* fix naming'

* fix errors

* example

* example implementations

* remove none

* more typing

* change condition

* add terrible draft of lifecycle query

* move around date query

* one random test to satisfy

* add funnel persons subquery

* basic func

* use key as event

* change condition

* change to countif

* add base query conditions

* add comments

* condition building

* person props

* param cleanup

* basic test

* stub tests

* remove unnecessary funcs

* adjust typing

* wip

* add filters to cohorts

* add migration, start refactoring property types

* proof of concept of property refactor

* add migration too

* clean up property types

* slight more clean up, add comments

* removed optimizer

* add comment

* support performed_event_regularly

* remove unneeded

* sql params on regular query

* more tests

* typing

* some more clean up, enable person property push downs

* add snapshots too

* clean up types and validation

* fix typing

* remove unused snapshot

* fix bug

* Update ee/clickhouse/queries/cohort_query.py

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

* oops

* update snapshots

* use materialized person props

* update fields

* add date value filter and tests

* event sequence join

* more join magic

* typing

* build fields

* see which tests fail

* resolve migrations conflict

* add some more tests

* fix first_time and event_restarted query

* add negation handling

* update snapshots

* add tests for multiple events case

* update stopped performing implementation

* regularly period validation

* old cohort support

* clean up + some tests

* fix some cohort tests issues

* split up

* remove migrations from this pr

* add migration

* missed file

* wip new cohort integration

* support cohortception

* update snapshot

* clean up

* support negations

* update snapshots

* more tests

* minor cleanup

* update snapshots

* wip

* fix tests, and detect loops

* update snapshots

* add cleanup util

* fix simplification

* update snapshots

* add test

* add logic

* update snapshot

* don't use snapshots in case

* update snapshot

* change create_event

* update test create funcs

* make field explicit

* update snapshots

* chore: update acceptance criteria and add ff

* chore(cohorts): Add acceptance criteria for new cohorts and feature flag functionality

* patch tests

* make API more frontend friendly

* proposal for instance setting

* Update posthog/models/cohort.py

* adjust API

* restore test

* fix api

* add conditoin

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: Rick Marron <rcmarron@gmail.com>
2022-05-03 10:25:53 -04:00
Neil Kakkar
57d5d04409
feat(cohorts): Cohorts migration to support new property types (#9512) 2022-05-02 16:51:56 +01:00
Eric Duong
6945566218
fix: patch cohort count for new queries (#9582)
* fix: patch cohort count for new queries

* update snapshot
2022-04-28 18:46:33 +00:00
Neil Kakkar
e531d0dc20
feat(cohorts): Backwards compatibility of groups and properties (#9462)
* add fields to property

* add validatoin

* fix naming'

* fix errors

* example

* example implementations

* remove none

* more typing

* change condition

* add terrible draft of lifecycle query

* move around date query

* one random test to satisfy

* add funnel persons subquery

* basic func

* use key as event

* change condition

* change to countif

* add base query conditions

* add comments

* condition building

* person props

* param cleanup

* basic test

* stub tests

* remove unnecessary funcs

* adjust typing

* wip

* add filters to cohorts

* add migration, start refactoring property types

* proof of concept of property refactor

* add migration too

* clean up property types

* slight more clean up, add comments

* removed optimizer

* add comment

* support performed_event_regularly

* remove unneeded

* sql params on regular query

* more tests

* typing

* some more clean up, enable person property push downs

* add snapshots too

* clean up types and validation

* fix typing

* remove unused snapshot

* fix bug

* Update ee/clickhouse/queries/cohort_query.py

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

* oops

* update snapshots

* use materialized person props

* update fields

* add date value filter and tests

* event sequence join

* more join magic

* typing

* build fields

* see which tests fail

* resolve migrations conflict

* add some more tests

* fix first_time and event_restarted query

* add negation handling

* update snapshots

* add tests for multiple events case

* update stopped performing implementation

* regularly period validation

* old cohort support

* clean up + some tests

* fix some cohort tests issues

* remove migrations from this pr

* clean up

* support negations

* update snapshots

* more tests

* did all tests just pass?

* fix new failing tests

* fix tests, try new format for cohort insertions

* inter-test dependency resolve

* gracefully handle empty cohorts

* add type annotation

* address comments

* remove properties select in cohort removal query

* address comment

* update snapshots

* add freeze time

* fix some tests

* remove the Xs

* more test fixes and clean up

* raise on cyclic dependencies instead

* fixes

* test waters with parallel execution

* fixes

* update tests

* final test

* clean up

* more test fixes

* gahhhhh

Co-authored-by: eric <eeoneric@gmail.com>
Co-authored-by: Rick Marron <rcmarron@gmail.com>
2022-04-27 16:29:56 -04:00
Tim Glaser
5887bd2143
test: Speed up backend tests (#9289)
* Durations

* patch sleep

* BULK

* SPEED UP EVERYTHING

* fiiix

* more tests

* morrr

* fix test

* Don't create demo data every time

* fix

* fix

* Affix

* fix

* fix

* fix

* fix

* fix

* More speed

* fix
2022-04-27 13:38:39 +01:00
Eric Duong
5eb98ef624
refactor: move event and person query to /posthog (#8970)
* refactor: move event and person query to /posthog

* move imports

* another import

* refactor: move actions

* refactor: move actions

* enterprise

* trigger tests

* test

* make dummy
2022-03-22 20:27:11 +00:00
Guido Iaquinti
0ef7f6a493
ci(flake8): enable unused import check (#8714) 2022-03-08 09:53:54 +01:00
Karl-Aksel Puulmann
2e038d4ae7
Remove more pg Events table usage (#8662)
* Remove Event dependency on action api tests

* Remove a dead function

* Remove BaseQuery

* Remove dead imports

* Remove Event creation from posthog/test/test_person_model.py

* Remove Event.earliest_timestamp function

* Remove some unused event model methods

* Remove query_db_by_action + associated migration code

* Remove dead filtering methods from Events model

* Remove a dead test class

* Remove some event model usage

* Remove events model usage from actions test

* Remove session recording related views

* Remove model usage in posthog/queries/session_recordings/session_recording.py

* Remove old pg-session recording code

* Remove dead import

* Re-add missing dependency

* Make lint/tests pass

* Make filter tests uuid-based
2022-02-17 12:47:11 +02:00
Paul D'Ambra
a314b61a02
Query person_distinct_id2 not person_distinct_id (#8358)
* add the fix and let CI say if that breaks any tests

* allow getting team IDS without direct substitution and mark all the places to check with TODOs

* pass team id in from everywhere and see what tests fail in CI

* named params everywhere

* address mypyc

* get tests passing

* fix tests after merge from master

* remove SQL query that's not referenced from anywhere

* check some marked queries are templated correctly now

* remove unused SQL

* check some marked queries are templated correctly now

* no optional team id

* more passing of team id into things

* don't trust autocomplete

* address review
2022-02-16 15:32:24 +00:00
Eric Duong
e1476dfaf4
Or property filtering API (#8012)
* add test

* update func

* add include and settings

* diff method

* some prelim changes to make backend work

* add tests and logic for handling groups

* setup basic mixin parsing

* add tests

* types and switchover

* adjustment

* update snapshots

* update more snapshots

* update more snapshots

* update more snapshots

* typing

* snapshots

* clean up TODOs and types

* separate to_dict

* another property dict fix

* use operator dependening on condition

* fix tests

* update tests

* remove dummy condition

* update tests

* change name to groups

* another label

* rename filter_group to property_group

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2022-02-14 13:39:48 -05:00
Eric Duong
e4f65b1790
8356 versioning (#8449)
* version insights

* version and lock update

* make sure all tests work

* restore exception

* fix test

* fix test

* add specific id

* update plugin server test utils

* cleanup

* match filtering

* use timestamp comparison

* make tests work

* one more test field

* fix more tests

* more cleanup

* lock frontend when updating and restore refresh

* pass undefined

* add timestamp to background update

* use incrementer

* add field

* snapshot

* types

* more cleanup

* update tests

* remove crumbs

* use expressions

* make nullable

* batch delete

* fill null for static cohorts

* batch_delete

* typing

* remove queryset function
2022-02-09 12:19:00 -05:00
Karl-Aksel Puulmann
e5ee7b4270
Read from and write to person_distinct_id2 if async migration is done (#7846)
* Run queries against person_distinct_id2 when async migration is done

* Only write to clickhouse_person_unique_id topic if async migration is incomplete

* Update query snapshots

* Update plugin-server

* Adjust caching logic
2022-01-05 13:11:33 +02:00
Eric Duong
fd49c6a9cc
[fix] Cohort 0 count bug fix (#7742) 2021-12-16 10:38:41 -06:00
Eric Duong
ae40b03932
fix cohort 0 argument (#7699) 2021-12-14 11:02:17 -05:00
Karl-Aksel Puulmann
3a4beda2ad
Speed up person_distinct_id queries for select clients (#7577)
* Create a new way to get distinct id queries thats gated by team_id

* Update most cases to use the new query

* Convert EVENT_JOIN_PERSON_SQL to new query

* Mostly convert GET_DISTINCT_IDS_BY_PERSON_ID_FILTER

* Mostly convert GET_DISTINCT_IDS_BY_PROPERTY_SQL

* Convert GET_PERSON_IDS_BY_FILTER

* Flag benchmarks

* Resolve circular imports

* Update a snapshot test

* Add a test for the new query logic
2021-12-08 15:59:41 +02:00
Tim Glaser
7fe96b813d
Fix error too deep recursion (#7445)
* Fix error too deep recursion

* Add space

* space no 'AND'

* update snapshots

* fix test

* fix test

* Remove team_id from prop_clause
2021-12-02 12:12:14 +01:00
Karl-Aksel Puulmann
7461f90153
Simplify cohort filters (#6277)
* WIP: Create new property types for simplified cohorts

* Add documentation on simplified_cohort_filter_properties

* Handle static-cohort/precalculated-cohort property types

* Handle new property filters properly

* Add casting

* Test cohorts in more cases

* Fix a bug

* Fix benchmark simplifying

* Avoid redoing work every setup for benchmarks

* Update typing;

* Remove unneeded scope

* Add tests for simplifying and cohorts

* Roll more of "do we need to join persons table" behavior into ClickhousePersonQuery class

* Handle precalculated cohort logic in sessions

* Simplify event query

* More tests without any JSONExtract

* Simplify entity properties as well

* Improve docstring

* Add test for breakdown & precalculated cohorts

* Add test for filtering sessions by precalculated cohorts

* Reset unneeded change

* Update cohort

* Solve some typing issues

* Update benchmarking

* Fix cohort filtering tests

* Fix cohort tests

* Fix a caching issue

* Typecheck

* Handle exclusion filters
2021-10-08 10:51:11 +03: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
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
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
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
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