posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix(hogql): robust funnel cache keys (2/x)

Open thmsobrmlr opened this issue 1 year ago â€ĸ 1 comments

Problem

This PR https://github.com/PostHog/posthog/pull/22419 introduced a clean_query, but we can get by with default values for most cases.

Changes

Replaces the clean_query method with default values. The model serializer does work as well indeed, but I opted for the simpler approach of just having default in the schema. This means not all queries that are semantically equal have the same cache key.

Todos

Queries

  • [x] TrendsQuery
  • [ ] FunnelsQuery
  • [ ] RetentionQuery
  • [ ] PathsQuery
  • [ ] StickinessQuery
  • [ ] LifecycleQuery
  • [ ] InsightActorsQuery
  • [ ] InsightActorsQueryOptions
  • [ ] FunnelCorrelationQuery
  • [ ] tbd

Series

  • [ ] EventsNode
  • [ ] ActionsNode
  • [ ] DataWarehouseNode

Properties

tbd

Insight Filters

  • [x] TrendsFilter
  • [x] FunnelsFilter
  • [ ] RetentionFilter
  • [ ] PathsFilter
  • [ ] StickinessFilter
  • [ ] LifecycleFilter

Other

  • [x] DateRange
  • [x] BreakdownFilter

How did you test this code?

Adapted tests

thmsobrmlr avatar May 23 '24 12:05 thmsobrmlr

Size Change: 0 B

Total Size: 1.05 MB

â„šī¸ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.05 MB

compressed-size-action

github-actions[bot] avatar May 29 '24 09:05 github-actions[bot]

Requesting another review here @PostHog/team-product-analytics, as the contents of the PR substantially changed since the last review.

thmsobrmlr avatar May 29 '24 11:05 thmsobrmlr

📸 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 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar May 31 '24 08:05 posthog-bot

📸 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 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar May 31 '24 08:05 posthog-bot

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • â€ŧī¸ ValidationError: 18 validation errors for TrendsQuery /api/projects/{parent_lookup_team_id}/insights/... View Issue
  • â€ŧī¸ ValidationError: 18 validation errors for TrendsQuery /api/projects/{parent_lookup_team_id}/dashboard... View Issue

Did you find this useful? React with a 👍 or 👎

sentry-io[bot] avatar Jun 04 '24 11:06 sentry-io[bot]