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 issues with step conversion times #5174

Merged
merged 12 commits into from
Jul 22, 2021
Merged

Fix issues with step conversion times #5174

merged 12 commits into from
Jul 22, 2021

Conversation

neilkakkar
Copy link
Collaborator

@neilkakkar neilkakkar commented Jul 16, 2021

Changes

Resolves some step conversion time issues

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests
  • Migrations are safe to run at scale (e.g. PostHog Cloud) – present proof if not obvious
  • New/changed UI is decent on smartphones (viewport width around 360px)

macobo and others added 3 commits July 16, 2021 16:22
As-is this default hurts local dev - one more setting you need to
export. Let's keep the setup simple instead.

Also the new default would have broken helm chart and production
when updating with new migrations - the cluster name there is `posthog`
for both it seems.

Let's force other deploys to be explicit instead.
@timgl timgl temporarily deployed to posthog-pr-5174 July 16, 2021 16:25 Inactive
@timgl timgl temporarily deployed to posthog-pr-5174 July 20, 2021 15:01 Inactive
{steps_per_person_query}
) GROUP BY person_id {breakdown_clause}
return f"""
SELECT person_id, steps {self._get_step_time_avgs(max_steps)} {breakdown_clause} FROM (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When some sequence of steps is a substring of itself, this previously led to incorrect results (since you want to average out times to convert of only the most-completed attempts)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This wasn't fully clear^

wrote a new test to explain this: test_funnel_with_multiple_incomplete_tries - when you do multiple incomplete tries, and multiple complete tries, only take into account the complete tries, since those are the ones that get counted (max(steps))

@timgl timgl temporarily deployed to posthog-pr-5174 July 20, 2021 15:35 Inactive
@timgl timgl temporarily deployed to posthog-pr-5174 July 21, 2021 13:22 Inactive
@neilkakkar neilkakkar marked this pull request as ready for review July 21, 2021 13:24
@neilkakkar neilkakkar requested a review from EDsCODE July 21, 2021 13:24
@@ -78,6 +78,58 @@ def test_auto_bin_count_single_step(self):
},
)

def test_auto_bin_count_single_step_duplicate_events(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This demonstrates the CH bug, will probably move this into a separate PR, since this edge case will remain flakey till its fixed upstream.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thinking of removing these from consideration in our time to convert funnels as a patch.

@timgl timgl temporarily deployed to posthog-pr-5174 July 21, 2021 13:49 Inactive
@timgl timgl temporarily deployed to posthog-pr-5174 July 21, 2021 13:53 Inactive
@neilkakkar neilkakkar requested a review from macobo July 21, 2021 13:58
@timgl timgl temporarily deployed to posthog-pr-5174 July 21, 2021 14:30 Inactive
Copy link
Member

@EDsCODE EDsCODE left a comment

Choose a reason for hiding this comment

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

good catch, lgtm

*Counting everything will be important for the funnel pattern where we don't distinguish by person and aggregate all the funnel attempts

@neilkakkar neilkakkar merged commit a0b99fa into master Jul 22, 2021
@neilkakkar neilkakkar deleted the fix-time-convert branch July 22, 2021 08:31
@neilkakkar
Copy link
Collaborator Author

Yup, indeed! When we get to implement that, it can be a conditional in the *_without_aggregation functions :)

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

4 participants