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

353 Commits

Author SHA1 Message Date
Guido Iaquinti
698baf61db
fix(misc): remove variable allocation when not needed (part #2) (#10502) 2022-06-27 12:21:01 +02:00
Eric Duong
2367289918
fix(person modal): Entity ambiguity (#10289)
* fix: person modal entity ambiguity

* fix: add test

* add field to stickiness

* test both labels

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2022-06-23 10:41:23 -04:00
Eric Duong
46faa8fab2
refactor(FOSS): foss remove all ee dependencies from /posthog (#10319)
* refactor: foss move properties to /posthog

* refactor: move replication and materializtaion

* refactor: move file

* refactor: move test and journeys

* refactor: move breakdown props

* refactor: move query imports

* refactor: move more ee dependencies

* refactor: restore groupsjoinquery

* fix: errors

* refactor: no ee.clickhouse dependncies

* try import tasks

* refactor: move materialization

* refactor: change foss split for column optimizer

* run black

* fix: imports

* remove comment

* Update snapshots

* run black

* skip isort

* Update snapshots

* format

* more fixes

* refactor(FOSS): split out paths query code (#10378)

* refactor: move migrations

* refactor: move idl

* fix: move more imports

* import adjustments

* fix: test import

* fix: test import

* fix: remove restriction

* refactor: split out paths query code

* refactor: more code splitting

* fix: types

* refactor(FOSS): Setup such that FOSS is deployable (#10352)

* refactor: move migrations

* refactor: move idl

* fix: move more imports

* import adjustments

* fix: test import

* fix: test import

* fix: remove restriction

* fix import

* refactor: add snapshost

* subscription-import

* fix: safe import

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-22 17:24:03 -04:00
Rick Marron
06c7c0a0fe
fix(session-analysis): dollar sign columns were erroring out formula queries (#10395)
* fix(session-analysis): dollar sign columns were erroring out formula queries

* better fix

* Update snapshots

* fix test

* Update snapshots

* clean up columns

* whelp, this is simpler

* oops

* revert some more

* update snapshots

* a bit simpler

* Update snapshots

* Update snapshots

* Update snapshots

* okkkkk - fixed + tested

* Update snapshots

* Update snapshots

* Update snapshots

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-22 10:26:50 -07:00
Rick Marron
dad8181db9
feat(session-analysis): Unique sessions (#10380)
* it works

* add some tests

* toss it behind a ff
2022-06-21 09:13:36 -07:00
Eric Duong
cb68eec23b
fix: caching remove flaky test (#10312)
* fix: remove flaky test

* chore: empty
2022-06-15 17:14:37 +01:00
Eric Duong
8f33e2924d
refactor: strict cache block (#10302)
* fix: disable breakdowns

* block formula

* refactor: only use on linear trends
2022-06-14 18:05:05 -04:00
Eric Duong
b684743464
fix(strict-caching): adjust logic and add better checks (#10300)
* fix: adjust logic and add better checks

* chore: empty

* more tests and handle all cases

* fix: types

* Update snapshots

* Update snapshots

* remove snapshots

* Update snapshots

* remove snapshots

* add comment

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-14 16:38:00 -04:00
Eric Duong
733db4c6bb
refactor: use cache for historical data (#10267)
* initial working

* initial working

* adjust args

* refactor: remove test changes

* refactor: uncomment

* remove junk

* fix: cleanup

* add test

* order of params

* fix tests

* Update snapshots

* fix typing

* add condition

* fix: cleanup

* fix: cleanup

* Update snapshots

* fix flag

* change snapshots

* change date

* add tests on merge results

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-14 12:05:21 -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
9adfaaaba6
refactor: move path query class from /ee to /posthog (#10140)
* refactor: move files

* refactor: variable naming

* factory pattern

* fix: restore exceptions hog

* remove factory pattern

* refactor: move files and change insight class

* move sql

* types

* fix imports

* fix imports

* refactor: propogate class

* fix import

* refactor: move paths to /posthog

* change imports for clickhousepathsactors

* change order

* fix: restructure imports

* fix imports

* move tests

* add dependency

* remove deprecated

* move tests

* inherit foss tests

* refactor: split stickiness /posthog and /ee (#10085)

* refactor: move files

* refactor: variable naming

* factory pattern

* fix: restore exceptions hog

* remove factory pattern

* fix imports

* fix import

* move test paths

* restore factory pattern

* add mixin

* change imports

* refactor: Foss funnels (#10204)

* refactor: move funnels and split according to foss

* ignore type on init

* fix: bad import
2022-06-09 15:09:00 +00:00
Eric Duong
e61b23cbcc
refactor: move retention query class from /ee to /posthog (#10137)
* refactor: move files and change insight class

* move sql

* types

* fix imports

* refactor: propogate class

* change order

* fix: restructure imports

* fix imports

* move tests

* add dependency

* remove deprecated

* inherit foss tests

* refactor: split stickiness /posthog and /ee (#10085)

* refactor: move files

* refactor: variable naming

* factory pattern

* fix: restore exceptions hog

* remove factory pattern

* fix imports

* fix import

* Update snapshots

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-07 12:52:45 -04:00
Neil Kakkar
4431c09f22
feat(funnels): breakdown by first-touch (and other) properties (#10062) 2022-06-06 11:37:58 +01:00
Eric Duong
4c3e713177
refactor: move persons util (#10079)
* refactor: move persons /clickhouse to /posthog

* remove leak

* fix: patch

* move import

* remove imports
2022-06-01 16:26:11 -04:00
Paul D'Ambra
415dfdd877
fix: do not delete experiment on soft deleting flags (#10047) 2022-05-30 17:27:44 +01:00
Neil Kakkar
304b51ec0e
fix(breakdowns): Make paging order stable (#10050) 2022-05-30 16:22:30 +01:00
Paul D'Ambra
de56d0bac0
fix: don't allow hard deletes on models with a soft delete option (#10018)
* delete insight to dashboard relation on soft delete of either

* refactor tests

* obey mypy

* don't allow hard delete of insights or dashboards

* soft deleted insights return 404 on get

* prove soft delete can be reversed

* no need to test permissions on delete that nobody can do

* no need to test permissions on delete that nobody can do

* don't allow hard delete on cohort

* don't allow annotation deletion

* don't allow hard deletion of actions

* undelete snapshot :/

* don't allow hard deletion of feature flag

* soft delete feature flag deletes experiments
2022-05-27 10:20:11 +01:00
Eric Duong
52f68a9daa
feat(person-on-events): Person on events funnels (#9822) 2022-05-25 13:19:58 +01:00
Neil Kakkar
5e09eba801
feat(retention): Enable person on events querying for retention (#9858)
* add constance setting

* add minimum viable code

* update journeys_for

* working test case

* chore: remove eventserializer in unnecessary places

* change execution

* change imports

* fix typing and tests

* change format

* adjust

* reset

* split group path in trend breakdown

* fix: typing

* fix test

* fix test, rename

* automatically add persons to events in tests on flush

* test CI with person-on-events

* wip

* fix

* fix ci

* add comma

* reduce test explosion

* fix CH server image version #9743

* update conditional

* split person on events

* split person on events

* split properly

* fix test deps

* add persons on events for tests

* rm eventserializer changes

* upd

* fix tests

* streamline person on event tests

* remove cache dependence, even after dematerialization deletion

* disregard snapshot tests

* no casting for matrix variables

* fix actions problems

* try to limit blast radius

* Update snapshots

* why are these tests passing?

* stoopid

* fix trend tests

* fix more trend tests, add test for old query regression

* Update snapshots

* optimise persons

* feat(retention): Enable person on events querying for retention

* update snaps

* Update snapshots

* Update snapshots

* fix tests

Co-authored-by: eric <eeoneric@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-23 16:24:17 -04:00
Neil Kakkar
60c0ddfb1a
feat(stickiness): Enable querying with person on events (#9884) 2022-05-23 15:00:04 +01:00
Eric Duong
df17af3d1e
feat(person-on-events): Person on events trends (#9645) 2022-05-23 10:26:14 +01:00
Neil Kakkar
4666d38b62
chore: Fix snapshots on master (#9885) 2022-05-20 16:24:03 +01:00
Karl-Aksel Puulmann
3412eed230
refactor: Remove constance library dependency, use json-encoded model (#9852)
* Populate the new model

* Add constance to admin

* Handle table not existing

* Add model tests

* Add tests for the constance model

* Fixup migrations

* Update instance settings to use new constance model

* update most readings

* Use override method in some tests

* Improve typing

* Prettier

* Merge 233 migration

* Order imports

* Fixup

* Update some query counts

* Remove dead import

* Improve some mypy

* Update team.py

* Remove constance library

* Mark migration as non-atomic

* Instance settings cleanup

* Rename methods to be more consistent

* Fixup for migration

* Update tests
2022-05-20 15:12:37 +03:00
Tim Glaser
967b50c3a0
fix(insights): Fix timezone date issues (#9678)
* fix(insights): Fix timezone date issues

* fix formatting

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix typescript

* Add snapshots for timezone tests

* Update snapshots

* fix with_data issue

* Update snapshots

* Update snapshots

* fix date_to and fix retention

* Fix retention

* Update snapshots

* Always set hourly intervals to 23:59:59, unless no date is given

* Update snapshots

* try always passing hourly through

* ifix

* fix

* fix mayb

* other fix

* fix

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-20 11:17:16 +01:00
Yakko Majuri
801c2a5f7e
feat(persons-on-events): add groups and persons columns to events schema (#9510)
* feat(persons-on-events): add persons and group cols to events

* snapshots

* Update ee/clickhouse/models/cohort.py

* update snapshots

* update kafka settings

* final modification to prevent temporary errors

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2022-04-29 11:31:32 +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
Tim Glaser
af4d0ae32d
fix(insights): timezone handle hour interval (#9463)
* fix: Handle hour interval with timezones

* handle hour interval

* fix tests

* fix

* don't ask for feature flag every time

* fix query count

* Raise on wrong timestamp
2022-04-22 10:11:21 +01:00
Marius Andra
1ddecf7800
feat(insights): dashboards insights many-to-many another attempt (#9416)
* dashboards and tiles, view mode, basic frontend typing

* update types, many-to-many relations

* update insight dashboards

* duplication works

* mypy

* fix migrations

* fix duplication bug

* add default filters

* fix caching

* deprecation nonsense

* remove things

* add nplus1 tests

* make nplus1 test need no explanation

* don't need to prefetch and select related

* move layouts API onto dashboard and store updates on DashboardTile

* apply dashboard filters to insights when loading dashboard

* don't need to update cached result in a cached function

* ugh, filter caching

* update basic serializer test

* add defaults when getting layout and colour from insights

* caching insights depends on filters hash changing when the insight is saved

* caching insights depends on filters hash changing when the insight is saved

* can't constantly resave insight filter hashes any more

* prettify the skip comment

* fix patch reference

* fix test assertion

* need to save dashboards to update insight filters_hash *until we fix filtering*

* add comment explaining why the test is failing - so I remember later

* blunt solution to not overwriting dashboard aware filter hash

* explode by 7 instead of 9 queries per insight added to dashboard

* mark some learning as a TODO

* only update dashboard layout when in edit mode

* insight logic no longer deals with saving layout

* skip the nplus1 test _for now_

* update the dashboard snapshots

* enrich insights with extra props when loaded in dashboard context

* update color via dashboard not insight

* create empty insight with a dashboards array, not a single dashboard

* remove empty TODO

* avoid initialising dashboardsmodel for dashboards logic tests

* no need to select and prefetch related

* order migration by last modified at

* remove insight layouts endpoint

* Add new from_dashboard parameter to API docs

* typo

* move deprecated fields on insight

* fix syntax error in migration file

* add permissions tests

* add help text to dashboards serializer field

* fix test with silent server errors

* down to 3 extra queries per insight on each dasboard

* down to 1 extra queries per insight on each dashboard

* set dashboard on context when retrieving an insight, so that filters are reported correctly

* explicitly fail to add insight to another team's dashboard

* update insight cache in correct context when refreshing

* add migration test

* satisfy the type checker

* Revert "satisfy the type checker"

This reverts commit 4d48a16cf4.

* satisfy the type checker

* really satisfy the type checker

* address two nits

* can ignore conflicts when inserting dashboard tiles

Co-authored-by: Paul D'Ambra <paul.dambra@gmail.com>
2022-04-22 09:03:22 +01:00
Tim Glaser
01f5949c0d
feat: Timezone support for charts (#9398)
* More fixes

* more

* update .ambr files

* fix tests

* fix

* fix

* fix tests

* fix cache
2022-04-19 12:33:37 +01:00
Neil Kakkar
a20d57ada3
feat(Universal-search): Search for literally anything in PostHog (#9299) 2022-04-19 10:26:10 +01:00
Yakko Majuri
c7d373364e
Revert "feat(persons-on-events): add required person and group columns to events table (#9251)" (#9406)
This reverts commit 3d71ad07cf.
2022-04-13 11:35:19 +00:00
Yakko Majuri
3d71ad07cf
feat(persons-on-events): add required person and group columns to events table (#9251)
* refactor(ingestion): establish setup for json consumption from kafka into clickhouse [nuke protobuf pt. 1]

* address review

* fix kafka table name across the board

* Update posthog/async_migrations/test/test_0004_replicated_schema.py

* run checks

* feat(persons-on-events): add required person and group columns to events table

* rename

* update snapshots

* address review

* Revert "update snapshots"

This reverts commit 63d7126e08.

* address review

* update snapshots

* update more snapshots

* use runpython

* update schemas

* update more queries

* some improvements :D

* fix naming

* fix breakdown prop name

* update snapshot

* fix naming

* fix ambiguous test

* fix queries'

* last bits

* fix typo to retrigger tests

* also handle kafka and mv tables in migration

* update snapshots

* drop tables if exists

Co-authored-by: eric <eeoneric@gmail.com>
2022-04-13 10:48:07 +00:00
Michael Matloka
0269041e27
feat(trends): World Map (#9291)
* Add game engine base

Fix `breakdown_limit`

* Remove cruft

* Add global illumination

Recognize map as non-time series

* Add sprites

Make `breakdown_limit` automagical

* Fix raytracing

Add basic map to the frontend

* DirectX 12

* Fix things

* Fix things

* Add new game mechanics

* Feature-flag it

* Try fixing more snapshots

* Add TODOs

* Fix things further

* Add new skill tree

* Fix things at last

* Importing models from 3D Studio Max

* Revert side refactor

* Fix clipping bug

Fix table value display

* Refactor main game loop

* Fix warlock attack

* Fix spacing

* Flip tooltip to the left when there isn't enough space

* Switch away when there are multiple series

* Also hide legend for table

* Reveal the truth

* Refactor `countries` out into `countryVectors.tsx`

* Restore Kosovo

* Add a story

* Adjust mechanics of one-series limitation

* Optimize map

* Disable "Compare to previous" for map

* Optimize color scheme

Co-authored-by: Marcus Hyett (PostHog) <85295485+marcushyett-ph@users.noreply.github.com>
2022-04-07 10:37:39 +02:00
Tim Glaser
e960bf3b64
perf(funnels): aggregate by distinct id for funnels (#9329)
* perf(funnels): aggregate by distinct id for funnels

* fix

* fi

* fix again

* fix
2022-04-01 20:34:55 +01:00
Harry Waye
fbdefdab1d
feat(trends): add moving average smoothing_intervals param (#6435)
* feat(trends): add moving average `smoothing_intervals` param

This will average over the preceding `smoothing_intervals` intervals.
The driver for this is to remove either weekly or monthly trends.

Limitations at the moment are that it only works for total volume
queries, as it relies on the results from clickhouse being from a single
timeline series.

* WIP UI for selecting smoothing

* WIP: Fix typing and appearce logic

* Made smoothing extensible beyond day

* Test now considers a non-trivial case

* chore(smoothing): use url params for state storage of smoothing value

This should allow for url navigation to work, although I haven't quite
figured out how we then use this to make the insights/trends POST
request

* Added further tests for smoothing intervals

* fix test_to_dict

* fix trend tests

* Added test to validate preceeding limit

* Fixed test for 2 interval

* clear django redis cache before each test

* add explicit ordering to dashboard items in refresh test

Otherwise the test is not deterministic.

* Revert "clear django redis cache before each test"

This is a good thing to do, but I don't want to open up a discussion on
this PR. It was not fix for the immediate intermittent
test_refresh_cache test

This reverts commit aa52f332f3.

* format

* clickhouse trends: SET allow_experimental_window_functions = 1

* fix setting of allow_experimental_window_functions

* add cache clears for requests

* Delete SmoothingFilterLogic.ts

Removed smoothing filter logic file

* Use `SMOOTHING_INTERVALS` instead of string literal

This should ensure that if we update the url param key somewhere, we don't have to remember to change it here as well.

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

* move test_trends to ee

* actually delete test_trends.py

* Transitioned smoothing logic to use Logic

* WIP: Moving away from url based logic

* WIP: Refactored logic on listeners

* fix storybook

* refactor

* set redis url

* remove keastory

* Move interval filter to setFilters insight logic

* update trend snapshots

* run prettier

* Add stickiness test deps that were in test_trends

* Fix storybook

* fix stickiness tests

* update snapshot

* fix cohort test

* only display smoothing on linear

* fix tests

* Add some tests

* added box to make dropdown consistent

* Floor

* fix tests

* fix tests

* fix test

* Add feature flag

Co-authored-by: Marcus Hyett <marcus@posthog.com>
Co-authored-by: Marcus Hyett (PostHog) <85295485+marcushyett-ph@users.noreply.github.com>
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: Tim Glaser <tim@glsr.nl>
2022-03-23 15:54:38 +00: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
Harry Waye
52ab4d5dd1
Revert "test(funnel): add test with multiple materialized dollar columns" (#9175)
I accidentally pushed this to master, this undoes that until it's
reviewed.

This reverts commit e94a4b6413.
2022-03-22 14:13:21 +00:00
Harry Waye
e94a4b6413 test(funnel): add test with multiple materialized dollar columns
ClickHouse 21.9 introduced heredoc syntax. The funnel queries have
repeated sections, one for each step within the funnel. As a result we
can end up in a situation where we create queries that include heredocs,
and as a result are invalid SQL queries.

This test just adds a test that is designed to produce a query that
would, assuming the implementation, produce a heredoc string.
2022-03-22 14:06:04 +00:00
Neil Kakkar
5d94e93784
test: retry flakey experiment tests on failure (#9015)
* test: retry flakey experiment tests on failure

* bump max runs
2022-03-15 11:08:35 +00:00
Neil Kakkar
2fe2f8352a
fix(retention): Fix persons call for retention (#8947) 2022-03-10 12:17:41 +00:00
Tim Glaser
dc1efb115e
perf: aggregate by distinct id (#8935)
* Perf: aggregate by distinct id

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2022-03-09 18:17:56 +00:00
Guido Iaquinti
b62eec33e6
feat(ClickHouse): fix ordering in tests (#8942) 2022-03-09 14:39:39 +01:00
Guido Iaquinti
0ef7f6a493
ci(flake8): enable unused import check (#8714) 2022-03-08 09:53:54 +01:00
Karl-Aksel Puulmann
2fb4f6f727
fix(clickhouse): Use replaceRegexpAll instead of trim() (#8892)
* Dont use trim() in clickhouse

trim broke in 21.12 and if we want to use if going forward, we need to
support working with a different version

* Update snapshots
2022-03-07 17:18:18 +02:00
Harry Waye
446cb48a48
fix(clickhouse): resolve 21.8 -> 21.9 test issues (again) (#8846)
* fix(clickhouse): resolve 21.8 -> 21.9 test issues

This is the minimum change to make
ee/clickhouse/queries/funnels/test/test_funnel_unordered.py::TestFunnelUnorderedStepsBreakdown::test_funnel_aggregate_by_groups_breakdown_group
pass. There may be other tests still failing.

The issue was introduced with the [addition of
heredocs](https://github.com/ClickHouse/ClickHouse/pull/26671) into the
clickhouse syntax. heredocs use `$` as delimiters. We're using `$` for
column identifiers in quite a few places, so now we need to ensure that
we have quoted these before rendering into SQL.

* update other snapshots

* update snapshots

* fix(clickhouse): quote materialized column identifiers
2022-03-03 15:53:12 +00:00
Eric Duong
69d3fce869
Filter groups simplify (#8683)
* initial working for trends with simplify

* simplify logic only if property_groups exists

* purge empty clauses

* fix tests

* fix snapshots

* update subquery logic

* update snapshots

* update snapshots

* columnoptimizer

* combine tests

* proof of concept simplification

* diff snapshots

* fix tests

* helpers and property_groups everywhere

* update snapshots

* fix simplify

* type

* missing argument

* add old properties back to simplify logic

* resolve merge conflicts, address few comments

* wip cleanup

* rm simplify filters

* redo removal

* update snapshots

* last snapshot

* update snapshot

* allow groups for breakdown props

* simplify

* fix foss tests

* run

* change groups to values

* change groups to values

* renaming

* add snapshots and test account logic

* Update posthog/models/filters/mixins/simplify.py

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

* make sure propertygroup objects can be directly parsed

* add one test

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2022-03-02 08:59:54 -05:00