posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat(hogql): ignore future persons

Open mariusandra opened this issue 1 year ago • 1 comments

Problem

https://posthog.slack.com/archives/C02E3BKC78F/p1716558850878309?thread_ts=1716503393.145799&cid=C02E3BKC78F

Changes

Exclude persons with future created_at dates

Does this work well for both Cloud and self-hosted?

I hope so.

How did you test this code?

CI + snapshots.

Running select * from persons under /debug adds the following: ifNull(less(person.created_at, plus(now64(6, %(hogql_val_6)s), toIntervalDay(1))), 0))

mariusandra avatar May 24 '24 14:05 mariusandra

Any query anywhere selecting persons will now have this applied to the subquery we make. See the generated SQL here.

image

mariusandra avatar May 24 '24 14:05 mariusandra