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 funnel hogql actors #20472

Merged
merged 27 commits into from
Feb 22, 2024
Merged

feat(hogql): add funnel hogql actors #20472

merged 27 commits into from
Feb 22, 2024

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Feb 20, 2024

Problem

Funnels need to be converted to HogQL (see the funnels section in PostHog/meta#130).

Changes

Adds frontend side handling of funnel actors and a HogQL version of actors for the regular funnel. The proposed schema for the actors nodes is now as following:

select * from (
    <ActorsQuery select={['properties.name']}>
        <FunnelsActorsQuery funnelStep={2}>
            <FunnelsQuery
                dateRange={<DateRange date_from='2020-01-01' date_to='2020-01-19' />}
                series={[<EventsNode event='$pageview' />, <EventsNode event='$pageview' />]}
            />
        </FunnelsActorsQuery>
    </ActorsQuery>
)

I kept the filter names similar to the existing ones e.g. funnelStep, but they could be shortened to e.g. step or something more expressive like actorsStep.

Follow-ups

How did you test this code?

Converted existing tests

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Feb 21, 2024

Size Change: +686 B (0%)

Total Size: 864 kB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 864 kB +686 B (0%)

compressed-size-action

@thmsobrmlr thmsobrmlr marked this pull request as ready for review February 21, 2024 20:31
@thmsobrmlr thmsobrmlr requested a review from a team February 21, 2024 20:31
Copy link
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

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

Looks good to me! 👍

model_config = ConfigDict(
extra="forbid",
)
includeRecordings: Optional[bool] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm actually not sure if this is ever False. It wasn't when I worked on it on paths. So we might just optimize this away and always return them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the hint, I'll double check this. I think for funnels this might be false for correlation queries or correlation actor queries. Might make sense to remove it from the schema though.

@thmsobrmlr thmsobrmlr merged commit c88988c into master Feb 22, 2024
81 checks passed
@thmsobrmlr thmsobrmlr deleted the funnel-hogql-actors branch February 22, 2024 13:00
@thmsobrmlr thmsobrmlr mentioned this pull request Feb 22, 2024
48 tasks
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