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

735 Commits

Author SHA1 Message Date
Anirudh Pillai
7ec262d3c8
fix: cohort query reduce memory usage (#24084)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-31 09:00:24 +01:00
Michael Matloka
26f0438221
chore(insights): Yeet groups-on-events from tests + optimizer (#23320)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-11 20:36:37 +02:00
Thomas Obermüller
d129190cae
refactor(queries): remove unused elements chain helper (#23568) 2024-07-11 12:07:26 +02:00
Sandy Spicer
39a4d278ec
fix: reduce cohort calculation memory usage (#23419) 2024-07-02 23:32:32 +00:00
Julian Bez
6c95fd18ba
chore(ruff): Add ruff rules for exception handling (#23251) 2024-06-27 12:39:21 +01:00
Michael Matloka
077b2759fd
chore(insights): Yeet the unbaked groups-on-events (#22764)
* chore(insights): Yeet the unbaked groups-on-events

* Update TestAutoProjectMiddleware

* Update verifiedDomainsLogic.test.ts.snap

* Update funnel_correlation.py

* Update test_property.py

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-24 16:38:42 +02:00
Michael Matloka
255229bd5b
fix(experiments): Prevent HogQL-only PoE modes breaking legacy insights (#22886)
* fix(experiments): Prevent HogQL-only PoE modes breaking legacy insights

* Actually leave `PERSON_ID_OVERRIDE_PROPERTIES_ON_EVENTS` alone
2024-06-11 23:08:08 +02:00
Thomas Obermüller
8ab8741e63
chore(refactor): pythonic schema (#22573) 2024-06-10 15:19:20 +02:00
timgl
1ec3b5fd41
feat: Always use person_distinct_id_override (#22347) 2024-06-05 12:51:54 -07:00
Ben White
cc9cb45d58
feat: Action steps refactor (attempt 2) (#22137) 2024-05-07 15:25:19 +02:00
Ben White
0fc2c9eccd
revert: "feat: Action steps refactor (part1) (#22091)" (#22136) 2024-05-07 12:32:41 +02:00
Ben White
776298d2a8
feat: Action steps refactor (part1) (#22091) 2024-05-07 12:08:13 +02:00
Julian Bez
9576fab1e4
chore: Add Pyupgrade rules (#21714)
* Add Pyupgrade rules
* Set correct Python version
2024-04-25 08:22:28 +01:00
Julian Bez
a0fc086175
chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
Michael Matloka
b7add1d252
refactor(querying): Consolidate PersonOnEventsMode and PersonsOnEventsMode (#21628)
* Consolidate `PersonOnEventsMode` and `PersonsOnEventsMode`

* Fix multi-line imports too

* Fix member casing

* Fix typing

* Fix some more and update baseline

* Fix `PersonsOnEventsMode` member capitalization
2024-04-19 10:06:55 +02:00
Neil Kakkar
703e0b8f66
fix(cohorts): Restrict query by time range (#21621) 2024-04-17 18:20:42 +00:00
Juraj Majerik
4d7e9d6da6
feat(experiments): no results Trends diagnostics (#21558) 2024-04-16 13:04:58 +00:00
Juraj Majerik
5128d29bae
feat(funnel experiment): no results diagnostics (#21400) 2024-04-16 07:07:15 +02:00
Neil Kakkar
de511eeb89
feat(cohorts): Allow adding property filters to events in cohorts (#21375) 2024-04-15 13:08:17 +01:00
timgl
6cf85db922
fix: Three clear options for persons on events (#21455)
* Revert "feat(hogql): Add feature flag for opting queries into v3 persons-on-events (#21150)"

This reverts commit 205376b86e.

* fix: Three clear options for persons on events

* Update UI snapshots for `chromium` (1)

* use UUID to target feature flag

* fix

* add missing option

* fix

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update posthog/models/team/team.py

Co-authored-by: ted kaemming <65315+tkaemming@users.noreply.github.com>

* Update posthog/models/team/team.py

Co-authored-by: ted kaemming <65315+tkaemming@users.noreply.github.com>

* fix schema

* fix

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ted kaemming <65315+tkaemming@users.noreply.github.com>
2024-04-11 18:58:35 +01:00
Juraj Majerik
ed0abf2d6f
feat(experiments): explore results in an insight (#21235)
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2024-04-11 11:05:41 +02:00
Julian Bez
487ca39064
chore: Enable more ruff rules (#21043) 2024-04-08 16:21:51 +01:00
Michael Matloka
1dcffffa0b
feat(dev): Show Celery cohort queries in CH debug modal (#21173)
* feat(dev): Show Celery cohort queries in CH debug modal

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Add test for `user_id:{self.user.id}`

* Fix args

* Update query snapshots

* Fix typing

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-02 17:56:51 +00:00
Neil Kakkar
575684fe1c
fix(experiments): Respect test account filters setting (#20730) 2024-03-06 14:52:45 +00:00
Neil Kakkar
a7aec2dcd3
feat(experiment): Significance for secondary metrics (#20156) 2024-02-21 15:51:15 +00:00
Juraj Majerik
464315a565
fix(funnel experiments): correct significance when *control* is winning (#20165) 2024-02-07 23:06:08 +01:00
Michael Matloka
69ab4dc9f1
perf(funnels): More deep filtering of person distinct ID join (#20112) 2024-02-07 09:23:06 +01:00
Juraj Majerik
d937315391
fix(experiments): fix funnel events validation (#20127) 2024-02-05 14:18:37 +00:00
Juraj Majerik
07cfe91b59
feat(experiments): validate events for Trend experiments (#20058)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-05 11:16:35 +00:00
Juraj Majerik
cb12ce03c2
fix(trend experiments): filter insight results correctly (#20080) 2024-02-01 14:55:00 +00:00
Michael Matloka
b93904e1cd
perf(funnels): Deep filtering of person distinct ID join (#20050)
* perf(funnels): Filter person distinct ID join

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-31 11:09:03 +01:00
Juraj Majerik
fe3c85ef9e
feat(experiments): validate events for Funnel experiments (#19988)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-31 08:38:01 +00:00
Marius Andra
26ddcccafb
fix(funnels): actors modal longer query limit (#19697) 2024-01-11 12:08:54 +01:00
Julian Bez
7cabe21ae3
chore: Upgrade pydantic, mypy, and others (#19660)
* Upgrade pydantic and all related
* Upgrade mypy
* Add mypy-baseline

To update baseline when you fix something (only then!) use:

    [mypy cmd] | mypy-baseline sync
2024-01-10 08:32:55 +00:00
Marius Andra
2944c06e53
fix(trends): fix "other" misalignment (#19484) 2023-12-22 09:36:18 +01:00
Marius Andra
3037124cdf
feat(insights): hide "other" breakdown (#19359) 2023-12-19 10:42:42 +01:00
Julian Bez
d637e409e6
fix(queries): Fix test involving timezone property (#19088)
Since timezone_info is calculated based on a field on the model that
comes directly from the database, caching it gets problematic.
Some tests change the underlying timezone, but timezone_info then
becomes stale.
Removing the cached_property decorator exposes some inaccurate tests.
2023-12-06 12:11:04 +00:00
Marius Andra
64f1f918b0
fix(hogql): equate equals and equals (#18655) 2023-11-16 10:03:03 +01:00
Michael Matloka
f986c242d5
fix(retention): Properly apply Monday as the first day of the week (#18481)
* fix(retention): Properly apply Monday as the first day of the week

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-08 21:29:44 +00:00
Ellie Huxtable
0257b2bcb9
chore: Use ruff formatter (#18207)
* Use ruff formatter

Ruff is now also a formatter! And it runs in a fraction of a second
across our whole codebase vs "I waited more than 30s and cancelled it
because I got bored".

* Config and command -> ruff

* Run 'ruff format .'

* Update query snapshots

* Run 'ruff format .'

* Fix format after commit hook

* Update query snapshots

* Fix type error - ignore comment moved

* Exclude hogql grammar from formatting and reverted grammar

* Run format

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tom Owers <tom@paace.co>
2023-10-31 13:41:57 +00:00
Michael Matloka
f7fd53680f
feat(query-engine): Add sessions timeline query (#18131)
* Remove unused `test_journeys.py`

* Add basic sessions timeline query node

* Snapshot sessions timeline test CH queries

* Support filtering by person UUID

* Support informal sessions

* Also fetch event elements

* Fix column names being swallowed in HogQL on timezone conversion

* Include recordings in the sessions timeline

* Move the schema additions to TypeScript

* Tune timeline query

* Simplify `journeys_for` API

* Re-engineer the query to support all cases

* Revert alias preservation change

* Fix existing tests without `event_uuid` specified

* Fix some tests using `journeys_for` failing

* Make `before` and `after` optional

* Fix more tests

* Don't suggest raw HogQL functions in close matches

* Add `to_persons_query`
2023-10-26 13:16:23 +00:00
Tom Owers
5513be7731
chore: upgraded Ruff linter (#18188)
* Upgraded Ruff linter

* Formatted whole codebase with new ruff rules

* Revert import removal

* Fixed mypi issues or added ignores

* Fixed schema formatting

* Fixed hogvm failing tests

* Remove duplicate key in list
2023-10-26 12:38:15 +02:00
Marius Andra
61d224cc01
feat(hogql): query modifiers (#17946) 2023-10-13 12:47:50 +02:00
Paul D'Ambra
31c1cdf301
chore: yeet CH recordings ingestion (#17572)
Removing ClickHouse based recordings

One big yeet for a man, a great yeet for humanity
2023-10-11 14:23:41 +01:00
timgl
476d102411
perf(Persons): Use optimize_aggregation_in_order for person queries (#17817)
* perf(Persons): Use optimize_aggregation_in_order for person queries

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-05 18:47:06 +01:00
Neil Kakkar
b8f123474c
fix(experiments): Dont show exposure for all property math except sum (#17715) 2023-10-03 10:18:06 +01:00
Thomas Obermüller
63d6dbc101
chore(python): replace pytz usages with ZoneInfo (#17344) 2023-09-12 09:38:25 +00:00
Thomas Obermüller
215de61589
chore(python): replace pytz.utc with ZoneInfo('UTC') (#17310) 2023-09-12 11:05:33 +02:00
Michael Matloka
d51e2b28b9
feat(insights): Parameterized first day of the week in queries (#16229)
* feat(insights): Allow either Monday or Sunday as week start

* "Weeks start on" to "Week starts on"

* Add `WeekStartDay` choices class

* Wrap interval SQL in `toDateTime()`

* Add printer test

* Fix malformed SQL

* Fix `BREAKDOWN_QUERY_SQL`

* Fix excess parenthesis

* Update test_event_query.py

* Fix `NULL_SQL`

* Add `team` to `Filter()` in a bunch of places

* Fix some num queries assertions

* Fix some timezone issues

* Fix funnel trends query syntax

* Fix a few issues

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Fix some query issues

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Fix properties timeline margin

* De-HogQL-ify `get_start_of_interval_sql`

* Make `get_start_of_interval_sql` robust

* Update UI snapshots for `chromium` (1)

* Restore snapshots from master

* Clean up and fix a missing timezone

* Make date and time settings nice

* Fix SUNDAY/MONDAY

Co-authored-by: Thomas Obermüller <thomas.obermueller@gmail.com>

* Revert `BUILT_IN_TABLE_NAMES`

* Revert new UI

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Fix `_table_names`

* Revert change adding more queries

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Fix minor issues flagged by tests

* Update query snapshots

* Split up `test_interval_filtering`

* Test Monday/Sunday setting in `test_timezones_weekly`

* Update query snapshots

* Add `WeekStartDay` cast

* Restore test_event_query.py

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Obermüller <thomas.obermueller@gmail.com>
2023-08-30 14:15:33 +02:00
Michael Matloka
77f3847efd
refactor(insights): Unify relative date parsing (#16965)
* Remove unused utils

* Unify relative date parsing

* Fix some missing timezone info

* Fix more issues

* Fix moar

* Remove redundant `strptime()`

* Add `test_hour_interval` snapshot

* Update formula `test_hour_interval`

* Fix timezone conversion

* Restore support for dates without zero padding

* Clarify `QueryDateRange`

* Snapshot `test_trends_compare_day_interval_relative_range`

* Fix `_end_time`/`_start_time` leftovers

* Remove stale TODO

* Fix remaining issues

* Limit truncation behavior

* Update query snapshots

* Remove truncation from events query

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-23 10:35:23 +02:00