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

17 Commits

Author SHA1 Message Date
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
Neil Kakkar
9fbf83ad19
chore(feature-flags): Use feature flag instead of instance setting fo… (#11092)
* chore(feature-flags): Use feature flag instead of instance setting for person on events

* fix tests where timezone flag was removed

* remove arg
2022-08-02 16:11:16 +01:00
Guido Iaquinti
698baf61db
fix(misc): remove variable allocation when not needed (part #2) (#10502) 2022-06-27 12:21:01 +02: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
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
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
60c0ddfb1a
feat(stickiness): Enable querying with person on events (#9884) 2022-05-23 15:00:04 +01: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
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
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
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
Guido Iaquinti
0ef7f6a493
ci(flake8): enable unused import check (#8714) 2022-03-08 09:53:54 +01:00
Eric Duong
4e0e69ac91
[actors] Stickiness actor pattern (#7440)
* separate class

* filter typing

* remove repeat

* refactor test

* add limits

* remove ee

* working tests

* working group tests for stickiness

* remove inits

* suggested changes

* typing

* adjust typing

* add correct params

* remove repeat
2021-12-02 11:43:20 -05:00
Harry Waye
f914e77f4f
refactor(stickiness): refactor one stickiness test to use api (#7398)
* refactor(stickiness): refactor one stickiness test to use api

This change demonstrates how to migrate a `Query` object level test to
an api based test. It purely focuses on the method of action invocation
and not on any of the e.g. setup or assertions. The StickinessQuery
object is only used by the REST API (and benchmarking), where as the
REST stickiness API is used by external users including our own frontend
developers, so makes sense to test at this level.

* Migrate stickiness query tests to api

This doesn't touch the stickiness people API however

* Migrate clickhouse specific stickiness tests

* Migrate stickiness people query tests to http api level

NOTE! This isn't just a straight migration, but also makes one important
change to application code that would otherwise result in a test
failure. Specifically, when trying to find an action based on the
`entity_id` query param, we need to consider that the entity_id is a
string. This is fine for when trying to find events, as we are comparing
event ids which are strings, but for actions the id is an int, so we
need to ensure we cast the action id to a string before comparison.

* Move stickiness query tests to api tests location

* make stickiness tests stable across postgres/clickhouse

* Add comment regarding casting action ids to strings
2021-11-30 13:40:15 +00:00