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

Setup Funnel Unordered persons and Testing #4943

Merged
merged 54 commits into from
Jul 1, 2021
Merged

Conversation

neilkakkar
Copy link
Collaborator

Changes

Fun stuff: Writing tests as I mentioned in https://github.com/PostHog/posthog/pull/4892/files#r660477225 helped me find bugs in our FunnelPersons class xD (sometimes, people are duplicated, more in the PR)

This PR: sets up a general method of creating Persons for queries, and tests them along with their non-Person class. I think it's imperative to test these two together, as this ensures (1) we don't duplicate all the tests twice, (2) what gets called together, gets tested together

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
  • Frontend/CSS is usable at 320px (iPhone SE) and decent at 360px (most phones)
  • Breaking changes are backwards-compatible. Ensure old/new frontend requests work with new/old backends, and vice versa.

buwilliams and others added 30 commits June 18, 2021 08:48
…ed funnel_persons and funnel_trends_persons into individual classes;
…com:PostHog/posthog into funnel-persons-pagination-conversion-window
@timgl timgl temporarily deployed to posthog-pr-4943 June 30, 2021 11:38 Inactive
Base automatically changed from funnel-unordered-step to master June 30, 2021 12:02
@neilkakkar neilkakkar requested review from EDsCODE and Twixes July 1, 2021 08:29
@timgl timgl temporarily deployed to posthog-pr-4943 July 1, 2021 08:29 Inactive
@@ -15,7 +15,7 @@
HUMAN_READABLE_TIMESTAMP_FORMAT = "%a. %-d %b"


class ClickhouseFunnelTrends(ClickhouseFunnelNew):
class ClickhouseFunnelTrends(ClickhouseFunnelBase):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Eventually, I think visualisation like Trends should inherit from the different types of ordered funnels, and use their now-new get_step_counts_query() as the seed query, but now's not the time for it. ( Want atleast a pattern of 2 before we generalise, so we don't create the wrong abstractions)

Copy link
Member

Choose a reason for hiding this comment

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

yup, agreed

@timgl timgl temporarily deployed to posthog-pr-4943 July 1, 2021 11:15 Inactive
@EDsCODE EDsCODE temporarily deployed to posthog-pr-4943 July 1, 2021 15:27 Inactive
@EDsCODE EDsCODE temporarily deployed to posthog-pr-4943 July 1, 2021 15:41 Inactive
@EDsCODE EDsCODE temporarily deployed to posthog-pr-4943 July 1, 2021 15:50 Inactive
@EDsCODE
Copy link
Member

EDsCODE commented Jul 1, 2021

I added the step timings into this query so that it's consistent. The timing themselves don't make much sense at the moment (can end up with negative values). This is worth investigating but I don't want it to be a blocker to get this merged because we can apply this persons pattern elsewhere

@EDsCODE EDsCODE merged commit e60e3c7 into master Jul 1, 2021
@EDsCODE EDsCODE deleted the funnel-unordered-persons branch July 1, 2021 16:11
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