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(experiments HogQL): add response attributes #25333

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

jurajmajerik
Copy link
Contributor

@jurajmajerik jurajmajerik commented Oct 2, 2024

Changes

Add the response and cached_response attributes to the experiment query runners. These are required for the /query call to work.

How did you test this code?

curl -X POST 'http://localhost:8000/api/projects/1/query/' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer phx_YcVWPEeurBaZ2sMKLywWa99dOTn7bBW9Jl5JaSDUUAR65Sy' \
-d '{
    "query": {
        "kind": "ExperimentTrendQuery",
        "experiment_id": 62,
        "count_query": {
            "kind": "TrendsQuery",
            "series": [
                {
                    "kind": "EventsNode",
                    "event": "[trend-40] event",
                    "name": "[trend-40] event",
                    "math": "total"
                }
            ]
        }
    }
}'

response:

{"cache_key":"cache_c0899aeb1f7e1d57199a7cf7cf894b35","cache_target_age":"2024-10-02T15:41:37.041889Z","calculation_trigger":null,"insight":"TRENDS","is_cached":false,"last_refresh":"2024-10-02T15:41:22.041889Z","next_allowed_client_refresh":"2024-10-02T15:42:22.041889Z","query_status":null,"results":{"control":{"count":120.0,"exposure":104.0},"test":{"count":295.0,"exposure":110.0}},"timezone":"UTC"}%   

Copy link
Contributor

github-actions bot commented Oct 2, 2024

Size Change: -14 B (0%)

Total Size: 9.21 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.21 MB -14 B (0%)

compressed-size-action

@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.

@jurajmajerik jurajmajerik changed the title feat(experiments HogQL): add cached response feat(experiments HogQL): add response attributes Oct 2, 2024
@jurajmajerik jurajmajerik marked this pull request as ready for review October 2, 2024 15:46
@jurajmajerik jurajmajerik requested a review from a team October 2, 2024 15:46
@jurajmajerik jurajmajerik merged commit d9d6296 into master Oct 3, 2024
93 checks passed
@jurajmajerik jurajmajerik deleted the experiments-hogql-cached-response branch October 3, 2024 08:50
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.

3 participants