Skip to content
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: stickiness actors query #27349

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

feat: stickiness actors query #27349

wants to merge 12 commits into from

Conversation

aspicer
Copy link
Contributor

@aspicer aspicer commented Jan 8, 2025

Problem

The stickiness actors query only returns the set of users that did the event exactly N times.

Changes

Create a StickinessActorsQuery with an operator that allows us to specify exact, gte, or lte.

This also adds an optional argument called intervalCount to the StickinessQuery which allows it to look at things like "2 day" intervals or "4 day" intervals. This is not used in the UI, but is used in the hogql cohort calculations.

When interval count is set, the StickinessQuery always looks at whole intervals that end at "date_to."

What this means is that if it is Jan 15th, and we are looking at Stickiness by month, the intervals will look like "Dec 16th -Jan 15th", "Nov 16th - Dec 15th", "Oct 16th - Nov 15th" etc.

This is to match the behavior of the current cohorts. This might make sense to add a flag to if we want to provide different options in the Stickiness UI, but for now only exists on the backend for cohorts.

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

Yes

How did you test this code?

Wrote a test, looked at SQL.

@posthog-bot
Copy link
Contributor

Hey @aspicer! 👋
This pull request seems to contain no description. Please add useful context, rationale, and/or any other information that will help make sense of this change now and in the distant Mars-based future.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@aspicer aspicer changed the title stickiness feat: stickiness query Jan 8, 2025
@aspicer aspicer changed the title feat: stickiness query feat: stickiness actors query Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Size Change: 0 B

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.11 MB

compressed-size-action

@aspicer aspicer requested a review from a team January 10, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants