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

chore(insights): rename the value field in multiple breakdowns #23890

Merged
merged 24 commits into from
Jul 23, 2024

Conversation

skoob13
Copy link
Contributor

@skoob13 skoob13 commented Jul 22, 2024

Problem

The PR renames the value to property field to improve backward compatibility with legacy multiple breakdowns because there are 17k+ saved funnels with the old shape.

Changes

  • Rename the field
  • Fix tests
  • Refactor cleaning filters to be backward compatible with legacy breakdowns (frontend)
  • Refactor conversion of filters to a query (backend)

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

Yes

How did you test this code?

Existing unit tests and manual testing.

@skoob13 skoob13 requested a review from a team July 22, 2024 14:53
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Jul 22, 2024

Size Change: 0 B

Total Size: 1.07 MB

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

compressed-size-action

Copy link
Contributor Author

@skoob13 skoob13 Jul 22, 2024

Choose a reason for hiding this comment

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

Snapshots are correct. They reverted to prior multiple breakdowns changes in Funnels: 7a3e849#diff-97ccf0cbc4b249f761838d67a3d9ccc7af51e8d5fbd01f6a871afcb22208c1a7.

@skoob13
Copy link
Contributor Author

skoob13 commented Jul 23, 2024

@thmsobrmlr a few notes about the PR:

  • the value field was renamed to property
  • filter_to_query (backend):
    • For Funnels: I reverted my changes here, so it extracts a first breakdown.
    • For Trends: keeps multiple breakdowns.
  • clean_filters (frontend):
    • For Funnels: keeps breakdowns as they were before.
    • For Trends: keeps multiple breakdowns and only restores the normalize_url.

@thmsobrmlr
Copy link
Contributor

For posterity, this gives us all insights from our team already using the trends multi-breakdowns:

SELECT filters->>'breakdowns', team_id, * FROM posthog_dashboarditem
WHERE filters->>'breakdowns' IS NOT NULL
AND filters->'breakdowns'->0->>'property' IS NULL

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • 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 1)
  • 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

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member

Choose a reason for hiding this comment

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

LGTM if looks good to Thomas, just is it expected for this dashboard to be blank?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a fix for that: #23904. I merged the master branch, so let me check if it fixes the snapshot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, it has fixed the snapshot.

skoob13 added 2 commits July 23, 2024 13:55
…ostHog/posthog into chore/rename-field-multiple-breakdowns
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • 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 1)
  • 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

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • 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

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

  • chromium: 0 added, 3 modified, 0 deleted (diff for shard 1)
  • 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 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@skoob13 skoob13 merged commit 1a3a550 into master Jul 23, 2024
91 checks passed
@skoob13 skoob13 deleted the chore/rename-field-multiple-breakdowns branch July 23, 2024 14:12
silentninja pushed a commit to silentninja/posthog that referenced this pull request Aug 8, 2024
…og#23890)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Obermüller <[email protected]>
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.

4 participants