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

feat(hogql): Add funnels to paths insight #21044

Closed
wants to merge 9 commits into from

Conversation

webjunkie
Copy link
Contributor

Problem

We left out funnels when working on the paths query.

Changes

  • use funnel actors query runner and join the resulting query

How did you test this code?

  • tbd

Copy link
Contributor

github-actions bot commented Mar 20, 2024

Size Change: -32 B (0%)

Total Size: 824 kB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 824 kB -32 B (0%)

compressed-size-action

@webjunkie
Copy link
Contributor Author

Feels ready and live compare shows nice green.

Copy link
Contributor

@thmsobrmlr thmsobrmlr left a comment

Choose a reason for hiding this comment

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

Looks solid overall, great to finally get the last piece missing in the HogQL conversion :)

There are some CI failures and I left a couple of comments inline. Also do we have existing tests for this? I usually found that converting the existing tests for the new implementation helped catch unexpected bugs.

frontend/src/queries/schema.ts Show resolved Hide resolved
and self.query.pathsFilter.funnelActorsQuery.funnelStep
and self.query.pathsFilter.funnelActorsQuery.funnelStep < 0
):
default_case += f" + INTERVAL {interval} {interval_unit}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just the other day I noticed an issue with HogQL and adding intervals. Basically ClickHouse requires the date to be in UTC, otherwise it will have an extra/missing hour for periods spanning a DST transition. See my fix and associated tests here: #21042. The solution for this is to wrap the relevant date in toTimeZone(mydate, 'UTC')

posthog/hogql_queries/insights/paths_query_runner.py Outdated Show resolved Hide resolved
@webjunkie
Copy link
Contributor Author

webjunkie commented Mar 24, 2024

A note on the status here. I want to check both things suggested by @thmsobrmlr but didn't get to it before my vacation.

  • update filters/query conversion
  • check interval timezone/dst conversions

@webjunkie webjunkie closed this in b169fc1 Apr 3, 2024
@webjunkie webjunkie deleted the feature/paths-funnels branch April 22, 2024 10:53
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.

2 participants