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(funnels): use hogql for legacy insight funnels api #27420

Merged
merged 12 commits into from
Jan 15, 2025

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Jan 9, 2025

Problem

We want to use HogQL queries for computing the legacy insight API endpoints. We use /query everywhere in our codebase, but the endpoints can still be called by customers.

Changes

Changes computation of the funnels endpoint to HogQL.

How did you test this code?

CI Run

and calling

http://localhost:8000/api/projects/1/insights/funnel
http://localhost:8000/api/projects/1/insights/funnel?query_method=legacy

with

{
    "events": [
        {"id": "$pageview", "order": 0},
        {"id": "$pageview", "order": 1},
        {"id": "$pageview", "order": 2}
    ],
    "insight": "FUNNELS",
    "date_from": "2025-01-01",
    "date_to": "2025-01-08",
    "funnel_window_days": 7,
    "funnel_order_type": "unordered",
    "breakdown_type": "event",
    "breakdown": "$browser"
}

Base automatically changed from legacy-api-use-hogql-trends to master January 13, 2025 15:07
@thmsobrmlr thmsobrmlr force-pushed the legacy-api-use-hogql-funnels branch from 88c1fdf to 2f26460 Compare January 13, 2025 15:11
@thmsobrmlr thmsobrmlr marked this pull request as ready for review January 13, 2025 16:27
@thmsobrmlr thmsobrmlr requested a review from a team January 13, 2025 16:28
posthog/api/insight.py Dismissed Show dismissed Hide dismissed
@thmsobrmlr thmsobrmlr merged commit 80b579b into master Jan 15, 2025
92 checks passed
@thmsobrmlr thmsobrmlr deleted the legacy-api-use-hogql-funnels branch January 15, 2025 16:10
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