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

Fix first time retention people query #3331

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

EDsCODE
Copy link
Member

@EDsCODE EDsCODE commented Feb 12, 2021

Changes

Please describe.

  • there was a bad operator in the query for first time retention
  • there wasn't a test for people under first time retention
  • addresses the query count issue of Bug with CH persons double click on retention table #2794 where there sometimes seemed to be way more results than the count at the top of the table (there is a separate issue with person id misfires)

If this affects the frontend, include screenshots.

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests

@EDsCODE EDsCODE requested a review from macobo February 12, 2021 18:24
@@ -70,5 +70,5 @@
from events e JOIN (SELECT person_id, distinct_id FROM person_distinct_id WHERE team_id = %(team_id)s) pdi on e.distinct_id = pdi.distinct_id
WHERE e.team_id = %(team_id)s {target_query} {filters}
GROUP BY person_id HAVING
min({trunc_func}(e.timestamp)) >= {trunc_func}(toDateTime(%(start_date)s))
min({trunc_func}(e.timestamp)) = {trunc_func}(toDateTime(%(start_date)s))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>= in this dummy filler query was grabbing all the people on the target date and ahead which is why the people modal always displayed way more one off users than actually counted

@timgl timgl temporarily deployed to posthog-retention-first-sgdpee February 12, 2021 18:27 Inactive
@EDsCODE EDsCODE temporarily deployed to posthog-retention-first-sgdpee February 12, 2021 18:52 Inactive
@EDsCODE EDsCODE merged commit 637f86d into master Feb 12, 2021
@EDsCODE EDsCODE deleted the retention-first-time-people-query-bug branch February 12, 2021 19:08
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.

None yet

2 participants