0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
posthog/ee
Harry Waye 3184db8aa0
fix(breakdown): resolve week rounding interval over shoot for trends (#6053)
* test(breakdown): add test for week interval rounding overshooting

This refers to https://github.com/PostHog/posthog/issues/2675

* fix(breakdown): resolve week rounding interval over shoot for trends

Previously there was a fix for another issue with weekly intervals not
spanning a large enough range, see
69ba0b1d90
for details.

The issue that this was trying to resolve was consider a date range
date_from, date_to and a week interval. The range can cross two weeks,
but prior to the above commit it would only show one tick/week on the
graph. In this case we just added on another week to show.

This doesn't help however in the case where the range is less than a
week, in which case we'd end up showing a week/tick on the graph with
a zero value.

Instead, we remove the additional 1 week and simply ensure that both
lower and upper bounds are included in the clickhouse zero fill.

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

* fix(lifecycle): update lifecycle to use updated week interval handling

This is due to the change in the way the week interval is handled in the
previous commi, where we removed a +1 we were adding to week intervals
and thus getting too many date axis ticks on trend graphs.

* ci(tests): only run non-ee tests for non ee action step

It seems that we are segregating tests between ee and non-ee via a
folder structure. This is a bit of a hack, but it works for now but
ideally we should converge on one set of tests for which we identify if
they are supported on clickhouse or not via pytest markers. This should
simplify working with the tests somewhat, e.g. making them easier to
locate, update, and e.g. debug in vscode/codespaces.

* test(trends): correct old week interval test. It was wrong before

Now with the change to how we create the interval, it's fixed.

* fix(trends): avoid including one week too many when deciding on bounds

Previously there was a test in here that was saying that if we request a
graph of events, with week interval ticks starting on a Sunday, we'd
actually end up also including the Sunday before due to some arithmetic
mistakes.

* fix(trends): resolve week interval rounding issues for trends query

* test(identify): update test func to accept `properties` argument
2021-09-22 18:28:25 +01:00
..
api Project-based permissioning framework (#5976) 2021-09-22 18:29:59 +02:00
bin Revert "Fix CH no data blocker (#5238)" (#5239) 2021-07-21 06:38:08 +00:00
certs
clickhouse fix(breakdown): resolve week rounding interval over shoot for trends (#6053) 2021-09-22 18:28:25 +01:00
idl
kafka_client Plugin log entries (#3482) 2021-05-06 10:54:32 +03:00
management/commands Move is_clickhouse_enabled from posthog.ee to posthog.utils (#5902) 2021-09-11 01:43:24 +02:00
migrations Project-based permissioning framework (#5976) 2021-09-22 18:29:59 +02:00
models Project-based permissioning framework (#5976) 2021-09-22 18:29:59 +02:00
tasks Send license usage (#6060) 2021-09-22 14:17:38 +02:00
__init__.py
apps.py
conftest.py dev(clickhouse): raise clickhouse setup errors quickly (#6069) 2021-09-22 10:22:52 +00:00
docker-compose.ch.arm64.yml ClickHouse M1 Docker (#5215) 2021-09-13 13:01:24 +02:00
docker-compose.ch.test.yml SAML deps build (#5932) 2021-09-14 11:43:26 +02:00
docker-compose.ch.yml Include users.xml config for dev/test clickhouse instance (#5732) 2021-08-25 01:47:15 +00:00
LICENSE
settings.py SAML deps build (#5932) 2021-09-14 11:43:26 +02:00
urls.py Project-based permissioning framework (#5976) 2021-09-22 18:29:59 +02:00