Skip to content

Commit

Permalink
chore(experiments HogQL): render main goal from HogQL (#25852)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik authored Oct 30, 2024
1 parent a9a77ac commit 019d4dc
Show file tree
Hide file tree
Showing 18 changed files with 810 additions and 321 deletions.
1 change: 1 addition & 0 deletions ee/clickhouse/views/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class Meta:
"created_by",
"created_at",
"updated_at",
"metrics",
]
read_only_fields = [
"id",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export const FEATURE_FLAGS = {
LEGACY_ACTION_WEBHOOKS: 'legacy-action-webhooks', // owner: @mariusandra #team-cdp
SESSION_REPLAY_URL_TRIGGER: 'session-replay-url-trigger', // owner: @richard-better #team-replay
REPLAY_TEMPLATES: 'replay-templates', // owner: @raquelmsmith #team-replay
EXPERIMENTS_HOGQL: 'experiments-hogql', // owner: @jurajmajerik #team-experiments
ROLE_BASED_ACCESS_CONTROL: 'role-based-access-control', // owner: @zach
EXPERIMENTS_HOLDOUTS: 'experiments-holdouts', // owner: @jurajmajerik #team-experiments
MESSAGING: 'messaging', // owner @mariusandra #team-cdp
Expand Down
160 changes: 150 additions & 10 deletions frontend/src/queries/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1315,12 +1315,25 @@
"expected_loss": {
"type": "number"
},
"funnels_query": {
"$ref": "#/definitions/FunnelsQuery"
},
"insight": {
"$ref": "#/definitions/FunnelsQueryResponse"
"items": {
"items": {
"type": "object"
},
"type": "array"
},
"type": "array"
},
"is_cached": {
"type": "boolean"
},
"kind": {
"const": "ExperimentFunnelsQuery",
"type": "string"
},
"last_refresh": {
"format": "date-time",
"type": "string"
Expand Down Expand Up @@ -1361,6 +1374,7 @@
"expected_loss",
"insight",
"is_cached",
"kind",
"last_refresh",
"next_allowed_client_refresh",
"probability",
Expand All @@ -1385,6 +1399,9 @@
"description": "What triggered the calculation of the query, leave empty if user/immediate",
"type": "string"
},
"count_query": {
"$ref": "#/definitions/TrendsQuery"
},
"credible_intervals": {
"additionalProperties": {
"items": {
Expand All @@ -1396,12 +1413,22 @@
},
"type": "object"
},
"exposure_query": {
"$ref": "#/definitions/TrendsQuery"
},
"insight": {
"$ref": "#/definitions/TrendsQueryResponse"
"items": {
"type": "object"
},
"type": "array"
},
"is_cached": {
"type": "boolean"
},
"kind": {
"const": "ExperimentTrendsQuery",
"type": "string"
},
"last_refresh": {
"format": "date-time",
"type": "string"
Expand Down Expand Up @@ -1444,6 +1471,7 @@
"credible_intervals",
"insight",
"is_cached",
"kind",
"last_refresh",
"next_allowed_client_refresh",
"p_value",
Expand Down Expand Up @@ -3732,8 +3760,21 @@
"expected_loss": {
"type": "number"
},
"funnels_query": {
"$ref": "#/definitions/FunnelsQuery"
},
"insight": {
"$ref": "#/definitions/FunnelsQueryResponse"
"items": {
"items": {
"type": "object"
},
"type": "array"
},
"type": "array"
},
"kind": {
"const": "ExperimentFunnelsQuery",
"type": "string"
},
"probability": {
"additionalProperties": {
Expand All @@ -3758,6 +3799,7 @@
"credible_intervals",
"expected_loss",
"insight",
"kind",
"probability",
"significance_code",
"significant",
Expand All @@ -3768,6 +3810,9 @@
{
"additionalProperties": false,
"properties": {
"count_query": {
"$ref": "#/definitions/TrendsQuery"
},
"credible_intervals": {
"additionalProperties": {
"items": {
Expand All @@ -3779,8 +3824,18 @@
},
"type": "object"
},
"exposure_query": {
"$ref": "#/definitions/TrendsQuery"
},
"insight": {
"$ref": "#/definitions/TrendsQueryResponse"
"items": {
"type": "object"
},
"type": "array"
},
"kind": {
"const": "ExperimentTrendsQuery",
"type": "string"
},
"p_value": {
"type": "number"
Expand All @@ -3807,6 +3862,7 @@
"required": [
"credible_intervals",
"insight",
"kind",
"p_value",
"probability",
"significance_code",
Expand Down Expand Up @@ -5215,8 +5271,21 @@
"expected_loss": {
"type": "number"
},
"funnels_query": {
"$ref": "#/definitions/FunnelsQuery"
},
"insight": {
"$ref": "#/definitions/FunnelsQueryResponse"
"items": {
"items": {
"type": "object"
},
"type": "array"
},
"type": "array"
},
"kind": {
"const": "ExperimentFunnelsQuery",
"type": "string"
},
"probability": {
"additionalProperties": {
Expand All @@ -5238,6 +5307,7 @@
}
},
"required": [
"kind",
"insight",
"variants",
"probability",
Expand Down Expand Up @@ -5282,6 +5352,9 @@
"ExperimentTrendsQueryResponse": {
"additionalProperties": false,
"properties": {
"count_query": {
"$ref": "#/definitions/TrendsQuery"
},
"credible_intervals": {
"additionalProperties": {
"items": {
Expand All @@ -5293,8 +5366,18 @@
},
"type": "object"
},
"exposure_query": {
"$ref": "#/definitions/TrendsQuery"
},
"insight": {
"$ref": "#/definitions/TrendsQueryResponse"
"items": {
"type": "object"
},
"type": "array"
},
"kind": {
"const": "ExperimentTrendsQuery",
"type": "string"
},
"p_value": {
"type": "number"
Expand All @@ -5319,6 +5402,7 @@
}
},
"required": [
"kind",
"insight",
"variants",
"probability",
Expand Down Expand Up @@ -8962,8 +9046,21 @@
"expected_loss": {
"type": "number"
},
"funnels_query": {
"$ref": "#/definitions/FunnelsQuery"
},
"insight": {
"$ref": "#/definitions/FunnelsQueryResponse"
"items": {
"items": {
"type": "object"
},
"type": "array"
},
"type": "array"
},
"kind": {
"const": "ExperimentFunnelsQuery",
"type": "string"
},
"probability": {
"additionalProperties": {
Expand All @@ -8985,6 +9082,7 @@
}
},
"required": [
"kind",
"insight",
"variants",
"probability",
Expand All @@ -8998,6 +9096,9 @@
{
"additionalProperties": false,
"properties": {
"count_query": {
"$ref": "#/definitions/TrendsQuery"
},
"credible_intervals": {
"additionalProperties": {
"items": {
Expand All @@ -9009,8 +9110,18 @@
},
"type": "object"
},
"exposure_query": {
"$ref": "#/definitions/TrendsQuery"
},
"insight": {
"$ref": "#/definitions/TrendsQueryResponse"
"items": {
"type": "object"
},
"type": "array"
},
"kind": {
"const": "ExperimentTrendsQuery",
"type": "string"
},
"p_value": {
"type": "number"
Expand All @@ -9035,6 +9146,7 @@
}
},
"required": [
"kind",
"insight",
"variants",
"probability",
Expand Down Expand Up @@ -9607,8 +9719,21 @@
"expected_loss": {
"type": "number"
},
"funnels_query": {
"$ref": "#/definitions/FunnelsQuery"
},
"insight": {
"$ref": "#/definitions/FunnelsQueryResponse"
"items": {
"items": {
"type": "object"
},
"type": "array"
},
"type": "array"
},
"kind": {
"const": "ExperimentFunnelsQuery",
"type": "string"
},
"probability": {
"additionalProperties": {
Expand All @@ -9633,6 +9758,7 @@
"credible_intervals",
"expected_loss",
"insight",
"kind",
"probability",
"significance_code",
"significant",
Expand All @@ -9643,6 +9769,9 @@
{
"additionalProperties": false,
"properties": {
"count_query": {
"$ref": "#/definitions/TrendsQuery"
},
"credible_intervals": {
"additionalProperties": {
"items": {
Expand All @@ -9654,8 +9783,18 @@
},
"type": "object"
},
"exposure_query": {
"$ref": "#/definitions/TrendsQuery"
},
"insight": {
"$ref": "#/definitions/TrendsQueryResponse"
"items": {
"type": "object"
},
"type": "array"
},
"kind": {
"const": "ExperimentTrendsQuery",
"type": "string"
},
"p_value": {
"type": "number"
Expand All @@ -9682,6 +9821,7 @@
"required": [
"credible_intervals",
"insight",
"kind",
"p_value",
"probability",
"significance_code",
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/queries/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,10 @@ export enum ExperimentSignificanceCode {
}

export interface ExperimentTrendsQueryResponse {
insight: TrendsQueryResponse
kind: NodeKind.ExperimentTrendsQuery
insight: Record<string, any>[]
count_query?: TrendsQuery
exposure_query?: TrendsQuery
variants: ExperimentVariantTrendsBaseStats[]
probability: Record<string, number>
significant: boolean
Expand All @@ -1633,7 +1636,9 @@ export interface ExperimentTrendsQueryResponse {
export type CachedExperimentTrendsQueryResponse = CachedQueryResponse<ExperimentTrendsQueryResponse>

export interface ExperimentFunnelsQueryResponse {
insight: FunnelsQueryResponse
kind: NodeKind.ExperimentFunnelsQuery
insight: Record<string, any>[][]
funnels_query?: FunnelsQuery
variants: ExperimentVariantFunnelsBaseStats[]
probability: Record<string, number>
significant: boolean
Expand Down
Loading

0 comments on commit 019d4dc

Please sign in to comment.