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

Breakdown person props naming bugs #5288

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

EDsCODE
Copy link
Member

@EDsCODE EDsCODE commented Jul 22, 2021

Changes

Please describe.

  • addresses some aspects of Breakdown on funnel fails to load #5211
  • for breakdown person props, our filters were sharing param key names and overwriting one another
  • the table name for the inner query was also incorrect
  • added a test
    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
  • 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)

@EDsCODE EDsCODE requested review from macobo and neilkakkar July 22, 2021 15:59
@timgl timgl temporarily deployed to posthog-pr-5288 July 22, 2021 16:01 Inactive
@neilkakkar
Copy link
Contributor

I don't 100% get how this test shows what was going wrong? We have a person breakdown test in breakdown_cases which was working beforehand, too O.o - would you mind adding another test to breakdown_cases that demonstrates how this is different / which cases it tests?

@EDsCODE
Copy link
Member Author

EDsCODE commented Jul 22, 2021

I don't think breakdown_cases is the right place to test this. This is broken for both funnels and trends because it's just the common query used to retrieve breakdown values. Any case that had regular properties and person properties was erroring because we call parse_prop_clauses twice but don't use different parameter keys so the second parse_prop_clauses was naming the parameters the same way. Also, the table name for the inner query was using "e" as a prefix but there was no table aliased as "e"

I think the move is to get this merged to resolve person property breakdowns and then I will continue writing out a full test suite for breakdown values. We have to keep this two query pattern and close #5186 because as @fuziontech figured out, CTEs don't work as expected on distributed tables

@neilkakkar
Copy link
Contributor

Sounds reasonable, I just meant: to show how it happens in a funnel query. Not a blocker, but I think a test like that makes it clearer, that this is what goes wrong: two properties, one on persons, second on events, and the persons one gets overriden, or whatever happens.

@EDsCODE
Copy link
Member Author

EDsCODE commented Jul 22, 2021

yeah got it. Going to merge this and add more tests

@EDsCODE EDsCODE merged commit 8e615e3 into master Jul 22, 2021
@EDsCODE EDsCODE deleted the 5211-load-breakdown-persons-with-test-account branch July 22, 2021 16:59
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.

3 participants