-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(insights): compare legacy and hogql insights #18628
Conversation
Size Change: 0 B Total Size: 2.01 MB ℹ️ View Unchanged
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
This is just a management command that's not run from anywhere, but is useful when comparing HogQL results between teams. Let's get it in, and possibly expand with other queries as we finish them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a lifecycle insight and got
posthog.hogql.errors.HogQLException: Unknown CompareOperationOp: InCohort
Not sure what that is.
But, yeah, can still be a useful command.
from posthog.hogql_queries.query_runner import get_query_runner | ||
|
||
insights = ( | ||
Insight.objects.filter(filters__contains={"insight": "LIFECYCLE"}, saved=True, deleted=False, team_id=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why team 2? For me it's 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what we have in production on the US cloud. The next version of this query should just check for all teams.
Oh, seems like you found a bug: lifecycle insights with cohort filters fail. Will fix. |
Ah, I just got super confused since it works in the frontend. Turns out it's one of my insights, but not the one I created right before. |
Fixed here: #19501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runs now for me. Let's get it in.
Problem
We want to launch HogQL trend and lifecycle insights. We also want to make sure the data is the same between the two.
Changes
Adds a management command that compares a set of lifecycle insight results.
How did you test this code?
I ran this in the python shell directly. I'll keep tweaking and running it like that for now. This PR is just a snapshot and likely won't get merged.