diff --git a/ee/hogai/assistant.py b/ee/hogai/assistant.py index 3a296ba9ce7d6..17a1c6341b667 100644 --- a/ee/hogai/assistant.py +++ b/ee/hogai/assistant.py @@ -1,10 +1,8 @@ import json -from collections.abc import AsyncGenerator, Generator, Iterator -from functools import partial +from collections.abc import Generator, Iterator from typing import Any, Optional from uuid import uuid4 -from asgiref.sync import sync_to_async from langchain_core.messages import AIMessageChunk from langchain_core.runnables.config import RunnableConfig from langfuse.callback import CallbackHandler @@ -20,6 +18,7 @@ from ee.hogai.trends.nodes import ( TrendsGeneratorNode, ) +from ee.hogai.utils.asgi import SyncIterableToAsync from ee.hogai.utils.state import ( GraphMessageUpdateTuple, GraphTaskStartedUpdateTuple, @@ -91,14 +90,8 @@ def stream(self): return self._astream() return self._stream() - async def _astream(self) -> AsyncGenerator[str, None]: - generator = self._stream() - while True: - try: - if message := await sync_to_async(partial(next, generator), thread_sensitive=False)(): - yield message - except StopIteration: - break + def _astream(self): + return SyncIterableToAsync(self._stream()) def _stream(self) -> Generator[str, None, None]: state = self._init_or_update_state() @@ -155,13 +148,8 @@ def _init_or_update_state(self): if snapshot.next: saved_state = validate_state_update(snapshot.values) self._state = saved_state - if saved_state.intermediate_steps: - intermediate_steps = saved_state.intermediate_steps.copy() - intermediate_steps[-1] = (intermediate_steps[-1][0], self._latest_message.content) - self._graph.update_state( - config, - PartialAssistantState(messages=[self._latest_message], intermediate_steps=intermediate_steps), - ) + self._graph.update_state(config, PartialAssistantState(messages=[self._latest_message], resumed=True)) + return None initial_state = self._initial_state self._state = initial_state diff --git a/ee/hogai/funnels/test/test_nodes.py b/ee/hogai/funnels/test/test_nodes.py index 4f4e9fca0e5d4..91b53d13cb9d3 100644 --- a/ee/hogai/funnels/test/test_nodes.py +++ b/ee/hogai/funnels/test/test_nodes.py @@ -33,6 +33,7 @@ def test_node_runs(self): new_state, PartialAssistantState( messages=[VisualizationMessage(answer=self.schema, plan="Plan", id=new_state.messages[0].id)], - intermediate_steps=None, + intermediate_steps=[], + plan="", ), ) diff --git a/ee/hogai/schema_generator/nodes.py b/ee/hogai/schema_generator/nodes.py index 4bed02fd462cc..98a5d6ede2eae 100644 --- a/ee/hogai/schema_generator/nodes.py +++ b/ee/hogai/schema_generator/nodes.py @@ -96,7 +96,8 @@ def _run_with_prompt( content=f"Oops! It looks like I’m having trouble generating this {self.INSIGHT_NAME} insight. Could you please try again?" ) ], - intermediate_steps=None, + intermediate_steps=[], + plan="", ) return PartialAssistantState( @@ -106,16 +107,17 @@ def _run_with_prompt( ], ) + final_message = VisualizationMessage( + plan=generated_plan, + answer=message.query, + initiator=start_id, + id=str(uuid4()), + ) + return PartialAssistantState( - messages=[ - VisualizationMessage( - plan=generated_plan, - answer=message.query, - initiator=start_id, - id=str(uuid4()), - ) - ], - intermediate_steps=None, + messages=[final_message], + intermediate_steps=[], + plan="", ) def router(self, state: AssistantState): diff --git a/ee/hogai/schema_generator/test/test_nodes.py b/ee/hogai/schema_generator/test/test_nodes.py index b44154b93b927..3b2702b55b7e1 100644 --- a/ee/hogai/schema_generator/test/test_nodes.py +++ b/ee/hogai/schema_generator/test/test_nodes.py @@ -54,7 +54,8 @@ def test_node_runs(self): ), {}, ) - self.assertIsNone(new_state.intermediate_steps) + self.assertEqual(new_state.intermediate_steps, []) + self.assertEqual(new_state.plan, "") self.assertEqual(len(new_state.messages), 1) self.assertEqual(new_state.messages[0].type, "ai/viz") self.assertEqual(new_state.messages[0].answer, self.schema) @@ -316,7 +317,7 @@ def test_node_leaves_failover(self): ), {}, ) - self.assertIsNone(new_state.intermediate_steps) + self.assertEqual(new_state.intermediate_steps, []) new_state = node.run( AssistantState( @@ -328,7 +329,7 @@ def test_node_leaves_failover(self): ), {}, ) - self.assertIsNone(new_state.intermediate_steps) + self.assertEqual(new_state.intermediate_steps, []) def test_node_leaves_failover_after_second_unsuccessful_attempt(self): node = DummyGeneratorNode(self.team) @@ -348,9 +349,10 @@ def test_node_leaves_failover_after_second_unsuccessful_attempt(self): ), {}, ) - self.assertIsNone(new_state.intermediate_steps) + self.assertEqual(new_state.intermediate_steps, []) self.assertEqual(len(new_state.messages), 1) self.assertIsInstance(new_state.messages[0], FailureMessage) + self.assertEqual(new_state.plan, "") def test_agent_reconstructs_conversation_with_failover(self): action = AgentAction(tool="fix", tool_input="validation error", log="exception") diff --git a/ee/hogai/summarizer/nodes.py b/ee/hogai/summarizer/nodes.py index 513246bcc1238..f03db53879268 100644 --- a/ee/hogai/summarizer/nodes.py +++ b/ee/hogai/summarizer/nodes.py @@ -1,8 +1,10 @@ +import datetime import json from time import sleep from uuid import uuid4 from django.conf import settings +from django.utils import timezone from django.core.serializers.json import DjangoJSONEncoder from langchain_core.prompts import ChatPromptTemplate from langchain_core.runnables import RunnableConfig @@ -76,11 +78,17 @@ def run(self, state: AssistantState, config: RunnableConfig) -> PartialAssistant chain = summarization_prompt | self._model + utc_now = timezone.now().astimezone(datetime.UTC) + project_now = utc_now.astimezone(self._team.timezone_info) + message = chain.invoke( { "query_kind": viz_message.answer.kind, "product_description": self._team.project.product_description, "results": json.dumps(results_response["results"], cls=DjangoJSONEncoder), + "utc_datetime_display": utc_now.strftime("%Y-%m-%d %H:%M:%S"), + "project_datetime_display": project_now.strftime("%Y-%m-%d %H:%M:%S"), + "project_timezone": self._team.timezone_info.tzname(utc_now), }, config, ) diff --git a/ee/hogai/summarizer/prompts.py b/ee/hogai/summarizer/prompts.py index bf2272d9d4cbe..9a85ee039ed5c 100644 --- a/ee/hogai/summarizer/prompts.py +++ b/ee/hogai/summarizer/prompts.py @@ -1,17 +1,29 @@ SUMMARIZER_SYSTEM_PROMPT = """ -Act as an expert product manager. Your task is to summarize query results in a a concise way. -Offer actionable feedback if possible. Only provide feedback that you're absolutely certain will be useful for this team. +Act as an expert product manager. Your task is to help the user build a successful product and business. +Also, you're a hedeghog named Max. + +Offer actionable feedback if possible. Only provide suggestions you're certain will be useful for this team. +Acknowledge when more information would be needed. When query results are provided, note that the user can already see the chart. + +Use Silicon Valley lingo. Be informal but get to the point immediately, without fluff - e.g. don't start with "alright, …". +NEVER use title case, even in headings. Our style is sentence case EVERYWHERE. +You can use Markdown for emphasis. Bullets can improve clarity of action points. The product being analyzed is described as follows: {{product_description}}""" SUMMARIZER_INSTRUCTION_PROMPT = """ -Here are the {{query_kind}} results for this question: +Here are results of the {{query_kind}} you created to answer my latest question: + ```json {{results}} ``` -Answer my earlier question using the results above. Point out interesting trends or anomalies. -Take into account what you know about my product. If possible, offer actionable feedback, but avoid generic advice. -Limit yourself to a few sentences. The answer needs to be high-impact and relevant for me as a Silicon Valley engineer. +The current date and time is {{utc_datetime_display}} UTC, which is {{project_datetime_display}} in this project's timezone ({{project_timezone}}). +It's expected that the data point for the current period can have a drop in value, as it's not complete yet - don't point this out to me. + +Based on the results, answer my question and provide actionable feedback. Avoid generic advice. Take into account what you know about the product. +The answer needs to be high-impact, no more than a few sentences. + +You MUST point out if the executed query or its results are insufficient for a full answer to my question. """ diff --git a/ee/hogai/taxonomy_agent/nodes.py b/ee/hogai/taxonomy_agent/nodes.py index bd26a7a93918f..92fe74ae55bcb 100644 --- a/ee/hogai/taxonomy_agent/nodes.py +++ b/ee/hogai/taxonomy_agent/nodes.py @@ -267,12 +267,18 @@ def _run_with_toolkit( ) if input.name == "ask_user_for_help": # The agent has requested help, so we interrupt the graph. - if not observation: + if not state.resumed: raise NodeInterrupt(input.arguments) # Feedback was provided. + last_message = state.messages[-1] + response = "" + if isinstance(last_message, HumanMessage): + response = last_message.content + return PartialAssistantState( - intermediate_steps=[*intermediate_steps[:-1], (action, observation)], + resumed=False, + intermediate_steps=[*intermediate_steps[:-1], (action, response)], ) output = "" diff --git a/ee/hogai/test/test_assistant.py b/ee/hogai/test/test_assistant.py index 6d0bb8807d629..48bb9b05d9b7e 100644 --- a/ee/hogai/test/test_assistant.py +++ b/ee/hogai/test/test_assistant.py @@ -2,6 +2,7 @@ from typing import Any, Optional, cast from unittest.mock import patch +import pytest from langchain_core import messages from langchain_core.agents import AgentAction from langchain_core.runnables import RunnableConfig, RunnableLambda @@ -10,7 +11,7 @@ from pydantic import BaseModel from ee.models.assistant import Conversation -from posthog.schema import AssistantMessage, HumanMessage, ReasoningMessage +from posthog.schema import AssistantMessage, FailureMessage, HumanMessage, ReasoningMessage from posthog.test.base import NonAtomicBaseTest from ..assistant import Assistant @@ -24,6 +25,10 @@ def setUp(self): super().setUp() self.conversation = Conversation.objects.create(team=self.team, user=self.user) + def _parse_stringified_message(self, message: str) -> tuple[str, Any]: + event_line, data_line, *_ = cast(str, message).split("\n") + return (event_line.removeprefix("event: "), json.loads(data_line.removeprefix("data: "))) + def _run_assistant_graph( self, test_graph: Optional[CompiledStateGraph] = None, @@ -44,8 +49,7 @@ def _run_assistant_graph( # Capture and parse output of assistant.stream() output: list[tuple[str, Any]] = [] for message in assistant.stream(): - event_line, data_line, *_ = cast(str, message).split("\n") - output.append((event_line.removeprefix("event: "), json.loads(data_line.removeprefix("data: ")))) + output.append(self._parse_stringified_message(message)) return output def assertConversationEqual(self, output: list[tuple[str, Any]], expected_output: list[tuple[str, Any]]): @@ -248,7 +252,7 @@ def test_funnels_interrupt_when_asking_for_help(self): ) self._test_human_in_the_loop(graph) - def test_intermediate_steps_are_updated_after_feedback(self): + def test_messages_are_updated_after_feedback(self): with patch("ee.hogai.taxonomy_agent.nodes.TaxonomyAgentPlannerNode._model") as mock: graph = ( AssistantGraph(self.team) @@ -282,6 +286,7 @@ def test_intermediate_steps_are_updated_after_feedback(self): action, observation = snapshot.values["intermediate_steps"][0] self.assertEqual(action.tool, "ask_user_for_help") self.assertIsNone(observation) + self.assertNotIn("resumed", snapshot.values) self._run_assistant_graph(graph, conversation=self.conversation, message="It's straightforward") snapshot: StateSnapshot = graph.get_state(config) @@ -294,6 +299,44 @@ def test_intermediate_steps_are_updated_after_feedback(self): action, observation = snapshot.values["intermediate_steps"][1] self.assertEqual(action.tool, "ask_user_for_help") self.assertIsNone(observation) + self.assertFalse(snapshot.values["resumed"]) + + def test_resuming_uses_saved_state(self): + with patch("ee.hogai.taxonomy_agent.nodes.TaxonomyAgentPlannerNode._model") as mock: + graph = ( + AssistantGraph(self.team) + .add_edge(AssistantNodeName.START, AssistantNodeName.FUNNEL_PLANNER) + .add_funnel_planner(AssistantNodeName.END) + .compile() + ) + config: RunnableConfig = { + "configurable": { + "thread_id": self.conversation.id, + } + } + + # Interrupt the graph + message = """ + Thought: Let's ask for help. + Action: + ``` + { + "action": "ask_user_for_help", + "action_input": "Need help with this query" + } + ``` + """ + mock.return_value = RunnableLambda(lambda _: messages.AIMessage(content=message)) + + self._run_assistant_graph(graph, conversation=self.conversation) + state: StateSnapshot = graph.get_state(config).values + self.assertIn("start_id", state) + self.assertIsNotNone(state["start_id"]) + + self._run_assistant_graph(graph, conversation=self.conversation, message="It's straightforward") + state: StateSnapshot = graph.get_state(config).values + self.assertIn("start_id", state) + self.assertIsNotNone(state["start_id"]) def test_new_conversation_handles_serialized_conversation(self): graph = ( @@ -319,3 +362,49 @@ def test_new_conversation_handles_serialized_conversation(self): is_new_conversation=False, ) self.assertNotEqual(output[0][0], "conversation") + + @pytest.mark.asyncio + async def test_async_stream(self): + graph = ( + AssistantGraph(self.team) + .add_node(AssistantNodeName.ROUTER, lambda _: {"messages": [AssistantMessage(content="bar")]}) + .add_edge(AssistantNodeName.START, AssistantNodeName.ROUTER) + .add_edge(AssistantNodeName.ROUTER, AssistantNodeName.END) + .compile() + ) + assistant = Assistant(self.team, self.conversation, HumanMessage(content="foo")) + assistant._graph = graph + + expected_output = [ + ("message", HumanMessage(content="foo")), + ("message", ReasoningMessage(content="Identifying type of analysis")), + ("message", AssistantMessage(content="bar")), + ] + actual_output = [self._parse_stringified_message(message) async for message in assistant._astream()] + self.assertConversationEqual(actual_output, expected_output) + + @pytest.mark.asyncio + async def test_async_stream_handles_exceptions(self): + def node_handler(state): + raise ValueError() + + graph = ( + AssistantGraph(self.team) + .add_node(AssistantNodeName.ROUTER, node_handler) + .add_edge(AssistantNodeName.START, AssistantNodeName.ROUTER) + .add_edge(AssistantNodeName.ROUTER, AssistantNodeName.END) + .compile() + ) + assistant = Assistant(self.team, self.conversation, HumanMessage(content="foo")) + assistant._graph = graph + + expected_output = [ + ("message", HumanMessage(content="foo")), + ("message", ReasoningMessage(content="Identifying type of analysis")), + ("message", FailureMessage()), + ] + actual_output = [] + with self.assertRaises(ValueError): + async for message in assistant._astream(): + actual_output.append(self._parse_stringified_message(message)) + self.assertConversationEqual(actual_output, expected_output) diff --git a/ee/hogai/trends/test/test_nodes.py b/ee/hogai/trends/test/test_nodes.py index 369ce8bc9b292..004ab58408d8e 100644 --- a/ee/hogai/trends/test/test_nodes.py +++ b/ee/hogai/trends/test/test_nodes.py @@ -38,6 +38,7 @@ def test_node_runs(self): new_state, PartialAssistantState( messages=[VisualizationMessage(answer=self.schema, plan="Plan", id=new_state.messages[0].id)], - intermediate_steps=None, + intermediate_steps=[], + plan="", ), ) diff --git a/ee/hogai/utils/asgi.py b/ee/hogai/utils/asgi.py new file mode 100644 index 0000000000000..a613ac8bb102c --- /dev/null +++ b/ee/hogai/utils/asgi.py @@ -0,0 +1,34 @@ +from collections.abc import AsyncIterator, Callable, Iterable, Iterator +from typing import TypeVar + +from asgiref.sync import sync_to_async + +T = TypeVar("T") + + +class SyncIterableToAsync(AsyncIterator[T]): + def __init__(self, iterable: Iterable[T]) -> None: + self._iterable: Iterable[T] = iterable + # async versions of the `next` and `iter` functions + self.next_async: Callable = sync_to_async(self.next, thread_sensitive=False) + self.iter_async: Callable = sync_to_async(iter, thread_sensitive=False) + self.sync_iterator: Iterator[T] | None = None + + def __aiter__(self) -> AsyncIterator[T]: + return self + + async def __anext__(self) -> T: + if self.sync_iterator is None: + self.sync_iterator = await self.iter_async(self._iterable) + return await self.next_async(self.sync_iterator) + + @staticmethod + def next(it: Iterator[T]) -> T: + """ + asyncio expects `StopAsyncIteration` in place of `StopIteration`, + so here's a modified in-built `next` function that can handle this. + """ + try: + return next(it) + except StopIteration: + raise StopAsyncIteration diff --git a/ee/hogai/utils/types.py b/ee/hogai/utils/types.py index 2df027b6f85af..917edb3d4987e 100644 --- a/ee/hogai/utils/types.py +++ b/ee/hogai/utils/types.py @@ -27,6 +27,7 @@ class _SharedAssistantState(BaseModel): The ID of the message from which the conversation started. """ plan: Optional[str] = Field(default=None) + resumed: Optional[bool] = Field(default=None) class AssistantState(_SharedAssistantState): @@ -34,7 +35,7 @@ class AssistantState(_SharedAssistantState): class PartialAssistantState(_SharedAssistantState): - messages: Optional[Annotated[Sequence[AssistantMessageUnion], operator.add]] = Field(default=None) + messages: Optional[Sequence[AssistantMessageUnion]] = Field(default=None) class AssistantNodeName(StrEnum): diff --git a/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png b/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png index 6724b2a2d5179..00916265cd38b 100644 Binary files a/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png and b/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png differ diff --git a/frontend/src/lib/monaco/codeEditorLogic.tsx b/frontend/src/lib/monaco/codeEditorLogic.tsx index 42e95f25209a4..b02e4d38d780a 100644 --- a/frontend/src/lib/monaco/codeEditorLogic.tsx +++ b/frontend/src/lib/monaco/codeEditorLogic.tsx @@ -29,7 +29,7 @@ import { import type { codeEditorLogicType } from './codeEditorLogicType' export const editorModelsStateKey = (key: string | number): string => `${key}/editorModelQueries` -export const activemodelStateKey = (key: string | number): string => `${key}/activeModelUri` +export const activeModelStateKey = (key: string | number): string => `${key}/activeModelUri` const METADATA_LANGUAGES = [HogLanguage.hog, HogLanguage.hogQL, HogLanguage.hogQLExpr, HogLanguage.hogTemplate] @@ -206,7 +206,7 @@ export const codeEditorLogic = kea([ if (values.featureFlags[FEATURE_FLAGS.MULTITAB_EDITOR] || values.featureFlags[FEATURE_FLAGS.SQL_EDITOR]) { const path = modelName.path.split('/').pop() - path && props.multitab && actions.setLocalState(activemodelStateKey(props.key), path) + path && props.multitab && actions.setLocalState(activeModelStateKey(props.key), path) } }, deleteModel: ({ modelName }) => { diff --git a/frontend/src/queries/nodes/HogQLQuery/HogQLQueryEditor.tsx b/frontend/src/queries/nodes/HogQLQuery/HogQLQueryEditor.tsx index 49ebdc16ae396..4c6dd4d8a70e6 100644 --- a/frontend/src/queries/nodes/HogQLQuery/HogQLQueryEditor.tsx +++ b/frontend/src/queries/nodes/HogQLQuery/HogQLQueryEditor.tsx @@ -10,7 +10,7 @@ import { LemonBanner } from 'lib/lemon-ui/LemonBanner' import { LemonButton } from 'lib/lemon-ui/LemonButton' import { CodeEditor } from 'lib/monaco/CodeEditor' import { - activemodelStateKey, + activeModelStateKey, codeEditorLogic, CodeEditorLogicProps, editorModelsStateKey, @@ -190,7 +190,7 @@ export function HogQLQueryEditor(props: HogQLQueryEditorProps): JSX.Element { setMonacoAndEditor([monaco, editor]) const allModelQueries = localStorage.getItem(editorModelsStateKey(codeEditorKey)) - const activeModelUri = localStorage.getItem(activemodelStateKey(codeEditorKey)) + const activeModelUri = localStorage.getItem(activeModelStateKey(codeEditorKey)) if (allModelQueries && multitab) { // clear existing models diff --git a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx index 2fd8adf883adb..517073e70c91f 100644 --- a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx +++ b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx @@ -7,6 +7,8 @@ import { useActions, useValues } from 'kea' import { AnimationType } from 'lib/animations/animations' import { Animation } from 'lib/components/Animation/Animation' import { ExportButton } from 'lib/components/ExportButton/ExportButton' +import { FEATURE_FLAGS } from 'lib/constants' +import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { useMemo } from 'react' import DataGrid from 'react-data-grid' import { InsightErrorState, StatelessInsightLoadingState } from 'scenes/insights/EmptyStates' @@ -45,6 +47,7 @@ export function OutputPane(): JSX.Element { const { dataWarehouseSavedQueriesLoading } = useValues(dataWarehouseViewsLogic) const { updateDataWarehouseSavedQuery } = useActions(dataWarehouseViewsLogic) const { visualizationType, queryCancelled } = useValues(dataVisualizationLogic) + const { featureFlags } = useValues(featureFlagLogic) const vizKey = useMemo(() => `SQLEditorScene`, []) @@ -91,10 +94,14 @@ export function OutputPane(): JSX.Element { key: OutputTab.Visualization, label: 'Visualization', }, - { - key: OutputTab.Info, - label: 'Info', - }, + ...(featureFlags[FEATURE_FLAGS.DATA_MODELING] + ? [ + { + key: OutputTab.Info, + label: 'Info', + }, + ] + : []), ]} />
diff --git a/frontend/src/scenes/data-warehouse/editor/QueryTabs.tsx b/frontend/src/scenes/data-warehouse/editor/QueryTabs.tsx index 85c9d80ef6270..d060984b41512 100644 --- a/frontend/src/scenes/data-warehouse/editor/QueryTabs.tsx +++ b/frontend/src/scenes/data-warehouse/editor/QueryTabs.tsx @@ -46,7 +46,7 @@ function QueryTabComponent({ model, active, onClear, onClick }: QueryTabProps): onClear ? 'pl-3 pr-2' : 'px-3' )} > - {model.view?.name ?? 'Untitled'} + {model.view?.name ?? 'New query'} {onClear && ( { diff --git a/frontend/src/scenes/data-warehouse/editor/multitabEditorLogic.tsx b/frontend/src/scenes/data-warehouse/editor/multitabEditorLogic.tsx index 94995a446ae2d..7f713327b5197 100644 --- a/frontend/src/scenes/data-warehouse/editor/multitabEditorLogic.tsx +++ b/frontend/src/scenes/data-warehouse/editor/multitabEditorLogic.tsx @@ -34,7 +34,8 @@ export interface MultitabEditorLogicProps { } export const editorModelsStateKey = (key: string | number): string => `${key}/editorModelQueries` -export const activemodelStateKey = (key: string | number): string => `${key}/activeModelUri` +export const activeModelStateKey = (key: string | number): string => `${key}/activeModelUri` +export const activeModelVariablesStateKey = (key: string | number): string => `${key}/activeModelVariables` export interface QueryTab { uri: Uri @@ -214,7 +215,7 @@ export const multitabEditorLogic = kea([ } const path = tab.uri.path.split('/').pop() - path && actions.setLocalState(activemodelStateKey(props.key), path) + path && actions.setLocalState(activeModelStateKey(props.key), path) }, deleteTab: ({ tab: tabToRemove }) => { if (props.monaco) { @@ -244,7 +245,13 @@ export const multitabEditorLogic = kea([ }, initialize: () => { const allModelQueries = localStorage.getItem(editorModelsStateKey(props.key)) - const activeModelUri = localStorage.getItem(activemodelStateKey(props.key)) + const activeModelUri = localStorage.getItem(activeModelStateKey(props.key)) + const activeModelVariablesString = localStorage.getItem(activeModelVariablesStateKey(props.key)) + const activeModelVariables = + activeModelVariablesString && activeModelVariablesString != 'undefined' + ? JSON.parse(activeModelVariablesString) + : {} + const mountedCodeEditorLogic = codeEditorLogic.findMounted() || codeEditorLogic({ @@ -285,6 +292,13 @@ export const multitabEditorLogic = kea([ activeModel && props.editor?.setModel(activeModel) const val = activeModel?.getValue() if (val) { + actions.setSourceQuery({ + ...values.sourceQuery, + source: { + ...values.sourceQuery.source, + variables: activeModelVariables, + }, + }) actions.setQueryInput(val) actions.runQuery() } @@ -323,6 +337,11 @@ export const multitabEditorLogic = kea([ }) localStorage.setItem(editorModelsStateKey(props.key), JSON.stringify(queries)) }, + setSourceQuery: ({ sourceQuery }) => { + // NOTE: this is a hack to get the variables to persist. + // Variables should be handled first in this logic and then in the downstream variablesLogic + localStorage.setItem(activeModelVariablesStateKey(props.key), JSON.stringify(sourceQuery.source.variables)) + }, runQuery: ({ queryOverride, switchTab }) => { const query = queryOverride || values.queryInput diff --git a/frontend/src/scenes/experiments/Experiment.stories.tsx b/frontend/src/scenes/experiments/Experiment.stories.tsx deleted file mode 100644 index 737b7f2973c12..0000000000000 --- a/frontend/src/scenes/experiments/Experiment.stories.tsx +++ /dev/null @@ -1,1488 +0,0 @@ -import { Meta, StoryFn } from '@storybook/react' -import { router } from 'kea-router' -import { useEffect } from 'react' -import { App } from 'scenes/App' -import { urls } from 'scenes/urls' - -import { mswDecorator } from '~/mocks/browser' -import { toPaginatedResponse } from '~/mocks/handlers' -import { - BreakdownAttributionType, - ChartDisplayType, - Experiment, - FunnelConversionWindowTimeUnit, - FunnelExperimentResults, - FunnelsFilterType, - FunnelVizType, - InsightType, - PropertyFilterType, - PropertyOperator, - SignificanceCode, - TrendsExperimentResults, -} from '~/types' - -const MOCK_FUNNEL_EXPERIMENT: Experiment = { - id: 1, - name: 'New sign-up flow', - description: - "We've rebuilt our sign-up page to offer a more personalized experience. Let's see if this version performs better with potential users.", - start_date: '2022-12-10T08:06:27.027740Z', - end_date: '2023-02-07T16:12:54.055481Z', - feature_flag_key: 'signup-page-4.0', - feature_flag: { - id: 1, - team_id: 1, - name: 'New sign-up page', - key: 'signup-page-4.0', - active: false, - deleted: false, - ensure_experience_continuity: false, - filters: { - groups: [ - { - properties: [ - { - key: 'company_name', - type: PropertyFilterType.Group, - value: 'awe', - operator: PropertyOperator.IContains, - group_type_index: 1, - }, - ], - variant: null, - rollout_percentage: undefined, - }, - ], - payloads: {}, - multivariate: { - variants: [ - { - key: 'control', - rollout_percentage: 33, - }, - { - key: 'test', - rollout_percentage: 33, - }, - { - key: 'test_group_2', - rollout_percentage: 34, - }, - ], - }, - aggregation_group_type_index: 1, - }, - }, - parameters: { - feature_flag_variants: [ - { - key: 'control', - rollout_percentage: 50, - }, - { - key: 'test', - rollout_percentage: 50, - }, - ], - recommended_sample_size: 137, - minimum_detectable_effect: 1, - }, - secondary_metrics: [], - filters: { - events: [ - { - id: '$pageview', - name: '$pageview', - type: 'events', - order: 0, - properties: [ - { - key: '$current_url', - type: 'event', - value: 'https://hedgebox.net/signup/', - operator: 'exact', - }, - ], - }, - { - id: 'signed_up', - name: 'signed_up', - type: 'events', - order: 1, - }, - ], - actions: [], - insight: InsightType.FUNNELS, - interval: 'day', - filter_test_accounts: true, - }, - metrics: [], - metrics_secondary: [], - archived: false, - created_by: { - id: 1, - uuid: '01863799-062b-0000-8a61-b2842d5f8642', - distinct_id: 'Sopz9Z4NMIfXGlJe6W1XF98GOqhHNui5J5eRe0tBGTE', - first_name: 'Employee 427', - email: 'test2@posthog.com', - }, - created_at: '2022-12-10T07:06:27.027740Z', - updated_at: '2023-02-09T19:13:57.137954Z', -} - -const MOCK_TREND_EXPERIMENT: Experiment = { - id: 2, - name: 'aloha', - start_date: '2023-02-11T10:37:17.634000Z', - end_date: null, - feature_flag_key: 'aloha', - feature_flag: { - id: 1, - team_id: 1, - name: 'Hellp everyone', - key: 'aloha', - active: false, - deleted: false, - ensure_experience_continuity: false, - filters: { - groups: [ - { - properties: [ - { - key: 'company_name', - type: PropertyFilterType.Person, - value: 'awesome', - operator: PropertyOperator.IContains, - }, - ], - variant: null, - rollout_percentage: undefined, - }, - ], - payloads: {}, - multivariate: { - variants: [ - { - key: 'control', - rollout_percentage: 50, - }, - { - key: 'test', - rollout_percentage: 50, - }, - ], - }, - }, - }, - metrics: [], - metrics_secondary: [], - parameters: { - feature_flag_variants: [ - { - key: 'control', - rollout_percentage: 50, - }, - { - key: 'test', - rollout_percentage: 50, - }, - ], - recommended_sample_size: 0, - recommended_running_time: 28.3, - }, - secondary_metrics: [], - filters: { - events: [ - { - id: '$pageview', - math: 'avg_count_per_actor', - name: '$pageview', - type: 'events', - order: 0, - }, - ], - actions: [], - date_to: '2023-05-19T23:59', - insight: InsightType.TRENDS, - interval: 'day', - date_from: '2023-05-05T11:36', - filter_test_accounts: false, - }, - archived: false, - created_by: { - id: 1, - uuid: '01881f35-b41a-0000-1d94-331938392cac', - distinct_id: 'Xr1OY26ZsDh9ZbvA212ggq4l0Hf0dmEUjT33zvRPKrX', - first_name: 'SS', - email: 'test@posthog.com', - is_email_verified: false, - }, - created_at: '2022-03-15T21:31:00.192917Z', - updated_at: '2022-03-15T21:31:00.192917Z', -} - -const MOCK_WEB_EXPERIMENT_MANY_VARIANTS: Experiment = { - id: 4, - name: 'web-experiment', - type: 'web', - start_date: '2023-02-11T10:37:17.634000Z', - end_date: null, - feature_flag_key: 'web-experiment', - feature_flag: { - id: 1, - team_id: 1, - name: 'Web Experiment on Hawaii.com', - key: 'web-experiment', - active: false, - deleted: false, - ensure_experience_continuity: false, - filters: { - groups: [ - { - properties: [ - { - key: 'company_name', - type: PropertyFilterType.Person, - value: 'awesome', - operator: PropertyOperator.IContains, - }, - ], - variant: null, - rollout_percentage: undefined, - }, - ], - payloads: {}, - multivariate: { - variants: [ - { - key: 'control', - rollout_percentage: 16, - }, - { - key: 'test_1', - rollout_percentage: 16, - }, - { - key: 'test_2', - rollout_percentage: 16, - }, - { - key: 'test_3', - rollout_percentage: 16, - }, - { - key: 'test_4', - rollout_percentage: 16, - }, - { - key: 'test_5', - rollout_percentage: 20, - }, - ], - }, - }, - }, - metrics: [], - metrics_secondary: [], - parameters: { - feature_flag_variants: [ - { - key: 'control', - rollout_percentage: 16, - }, - { - key: 'test_1', - rollout_percentage: 16, - }, - { - key: 'test_2', - rollout_percentage: 16, - }, - { - key: 'test_3', - rollout_percentage: 16, - }, - { - key: 'test_4', - rollout_percentage: 16, - }, - { - key: 'test_5', - rollout_percentage: 20, - }, - ], - recommended_sample_size: 0, - recommended_running_time: 28.3, - }, - secondary_metrics: [], - filters: { - events: [ - { - id: '$pageview', - math: 'avg_count_per_actor', - name: '$pageview', - type: 'events', - order: 0, - }, - ], - actions: [], - date_to: '2023-05-19T23:59', - insight: InsightType.TRENDS, - interval: 'day', - date_from: '2023-05-05T11:36', - filter_test_accounts: false, - }, - archived: false, - created_by: { - id: 1, - uuid: '01881f35-b41a-0000-1d94-331938392cac', - distinct_id: 'Xr1OY26ZsDh9ZbvA212ggq4l0Hf0dmEUjT33zvRPKrX', - first_name: 'SS', - email: 'test@posthog.com', - is_email_verified: false, - }, - created_at: '2022-03-15T21:31:00.192917Z', - updated_at: '2022-03-15T21:31:00.192917Z', -} - -const MOCK_TREND_EXPERIMENT_MANY_VARIANTS: Experiment = { - id: 3, - name: 'aloha', - start_date: '2023-02-11T10:37:17.634000Z', - end_date: null, - feature_flag_key: 'aloha', - feature_flag: { - id: 1, - team_id: 1, - name: 'Hellp everyone', - key: 'aloha', - active: false, - deleted: false, - ensure_experience_continuity: false, - filters: { - groups: [ - { - properties: [ - { - key: 'company_name', - type: PropertyFilterType.Person, - value: 'awesome', - operator: PropertyOperator.IContains, - }, - ], - variant: null, - rollout_percentage: undefined, - }, - ], - payloads: {}, - multivariate: { - variants: [ - { - key: 'control', - rollout_percentage: 16, - }, - { - key: 'test_1', - rollout_percentage: 16, - }, - { - key: 'test_2', - rollout_percentage: 16, - }, - { - key: 'test_3', - rollout_percentage: 16, - }, - { - key: 'test_4', - rollout_percentage: 16, - }, - { - key: 'test_5', - rollout_percentage: 20, - }, - ], - }, - }, - }, - metrics: [], - metrics_secondary: [], - parameters: { - feature_flag_variants: [ - { - key: 'control', - rollout_percentage: 16, - }, - { - key: 'test_1', - rollout_percentage: 16, - }, - { - key: 'test_2', - rollout_percentage: 16, - }, - { - key: 'test_3', - rollout_percentage: 16, - }, - { - key: 'test_4', - rollout_percentage: 16, - }, - { - key: 'test_5', - rollout_percentage: 20, - }, - ], - recommended_sample_size: 0, - recommended_running_time: 28.3, - }, - secondary_metrics: [], - filters: { - events: [ - { - id: '$pageview', - math: 'avg_count_per_actor', - name: '$pageview', - type: 'events', - order: 0, - }, - ], - actions: [], - date_to: '2023-05-19T23:59', - insight: InsightType.TRENDS, - interval: 'day', - date_from: '2023-05-05T11:36', - filter_test_accounts: false, - }, - archived: false, - created_by: { - id: 1, - uuid: '01881f35-b41a-0000-1d94-331938392cac', - distinct_id: 'Xr1OY26ZsDh9ZbvA212ggq4l0Hf0dmEUjT33zvRPKrX', - first_name: 'SS', - email: 'test@posthog.com', - is_email_verified: false, - }, - created_at: '2022-03-15T21:31:00.192917Z', - updated_at: '2022-03-15T21:31:00.192917Z', -} - -const MOCK_EXPERIMENT_RESULTS: FunnelExperimentResults = { - result: { - fakeInsightId: '123', - insight: [ - [ - { - action_id: '$pageview', - name: '$pageview', - order: 0, - people: [], - count: 71, - type: 'events', - average_conversion_time: null, - median_conversion_time: null, - breakdown: ['test'], - breakdown_value: ['test'], - converted_people_url: - '/api/person/funnel/?breakdown=%5B%22%24feature%2Fsignup-page-4.0%22%5D&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2022-12-10T08%3A06%3A27.027740%2B00%3A00&date_to=2023-02-07T16%3A12%3A54.055481%2B00%3A00&explicit_date=true&display=FunnelViz&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24current_url%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%22https%3A%2F%2Fhedgebox.net%2Fsignup%2F%22%7D%5D%7D%7D%2C+%7B%22id%22%3A+%22signed_up%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+1%2C+%22name%22%3A+%22signed_up%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&filter_test_accounts=True&funnel_step_breakdown=%5B%22test%22%5D&funnel_step=1&funnel_viz_type=steps&funnel_window_interval=14&funnel_window_interval_unit=day&insight=FUNNELS&interval=day&limit=100&smoothing_intervals=1', - dropped_people_url: null, - }, - { - action_id: 'signed_up', - name: 'signed_up', - order: 1, - people: [], - count: 43, - type: 'events', - average_conversion_time: 53.04651162790697, - median_conversion_time: 53, - breakdown: ['test'], - breakdown_value: ['test'], - converted_people_url: - '/api/person/funnel/?breakdown=%5B%22%24feature%2Fsignup-page-4.0%22%5D&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2022-12-10T08%3A06%3A27.027740%2B00%3A00&date_to=2023-02-07T16%3A12%3A54.055481%2B00%3A00&explicit_date=true&display=FunnelViz&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24current_url%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%22https%3A%2F%2Fhedgebox.net%2Fsignup%2F%22%7D%5D%7D%7D%2C+%7B%22id%22%3A+%22signed_up%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+1%2C+%22name%22%3A+%22signed_up%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&filter_test_accounts=True&funnel_step_breakdown=%5B%22test%22%5D&funnel_step=2&funnel_viz_type=steps&funnel_window_interval=14&funnel_window_interval_unit=day&insight=FUNNELS&interval=day&limit=100&smoothing_intervals=1', - dropped_people_url: - '/api/person/funnel/?breakdown=%5B%22%24feature%2Fsignup-page-4.0%22%5D&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2022-12-10T08%3A06%3A27.027740%2B00%3A00&date_to=2023-02-07T16%3A12%3A54.055481%2B00%3A00&explicit_date=true&display=FunnelViz&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24current_url%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%22https%3A%2F%2Fhedgebox.net%2Fsignup%2F%22%7D%5D%7D%7D%2C+%7B%22id%22%3A+%22signed_up%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+1%2C+%22name%22%3A+%22signed_up%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&filter_test_accounts=True&funnel_step_breakdown=%5B%22test%22%5D&funnel_step=-2&funnel_viz_type=steps&funnel_window_interval=14&funnel_window_interval_unit=day&insight=FUNNELS&interval=day&limit=100&smoothing_intervals=1', - }, - ], - [ - { - action_id: '$pageview', - name: '$pageview', - custom_name: null, - order: 0, - people: [], - count: 69, - type: 'events', - average_conversion_time: null, - median_conversion_time: null, - breakdown: ['control'], - breakdown_value: ['control'], - converted_people_url: - '/api/person/funnel/?breakdown=%5B%22%24feature%2Fsignup-page-4.0%22%5D&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2022-12-10T08%3A06%3A27.027740%2B00%3A00&date_to=2023-02-07T16%3A12%3A54.055481%2B00%3A00&explicit_date=true&display=FunnelViz&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24current_url%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%22https%3A%2F%2Fhedgebox.net%2Fsignup%2F%22%7D%5D%7D%7D%2C+%7B%22id%22%3A+%22signed_up%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+1%2C+%22name%22%3A+%22signed_up%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&filter_test_accounts=True&funnel_step_breakdown=%5B%22control%22%5D&funnel_step=1&funnel_viz_type=steps&funnel_window_interval=14&funnel_window_interval_unit=day&insight=FUNNELS&interval=day&limit=100&smoothing_intervals=1', - dropped_people_url: null, - }, - { - action_id: 'signed_up', - name: 'signed_up', - custom_name: null, - order: 1, - people: [], - count: 31, - type: 'events', - average_conversion_time: 66.6774193548387, - median_conversion_time: 63, - breakdown: ['control'], - breakdown_value: ['control'], - converted_people_url: - '/api/person/funnel/?breakdown=%5B%22%24feature%2Fsignup-page-4.0%22%5D&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2022-12-10T08%3A06%3A27.027740%2B00%3A00&date_to=2023-02-07T16%3A12%3A54.055481%2B00%3A00&explicit_date=true&display=FunnelViz&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24current_url%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%22https%3A%2F%2Fhedgebox.net%2Fsignup%2F%22%7D%5D%7D%7D%2C+%7B%22id%22%3A+%22signed_up%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+1%2C+%22name%22%3A+%22signed_up%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&filter_test_accounts=True&funnel_step_breakdown=%5B%22control%22%5D&funnel_step=2&funnel_viz_type=steps&funnel_window_interval=14&funnel_window_interval_unit=day&insight=FUNNELS&interval=day&limit=100&smoothing_intervals=1', - dropped_people_url: - '/api/person/funnel/?breakdown=%5B%22%24feature%2Fsignup-page-4.0%22%5D&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2022-12-10T08%3A06%3A27.027740%2B00%3A00&date_to=2023-02-07T16%3A12%3A54.055481%2B00%3A00&explicit_date=true&display=FunnelViz&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24current_url%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%22https%3A%2F%2Fhedgebox.net%2Fsignup%2F%22%7D%5D%7D%7D%2C+%7B%22id%22%3A+%22signed_up%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+1%2C+%22name%22%3A+%22signed_up%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+null%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&filter_test_accounts=True&funnel_step_breakdown=%5B%22control%22%5D&funnel_step=-2&funnel_viz_type=steps&funnel_window_interval=14&funnel_window_interval_unit=day&insight=FUNNELS&interval=day&limit=100&smoothing_intervals=1', - }, - ], - ], - probability: { - control: 0.03264999999999996, - test: 0.96735, - }, - significant: false, - filters: { - breakdown: ['$feature/signup-page-4.0'], - breakdown_attribution_type: BreakdownAttributionType.FirstTouch, - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2022-12-10T08:06:27.027740+00:00', - date_to: '2023-02-07T16:12:54.055481+00:00', - explicit_date: 'true', - display: 'FunnelViz', - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: null, - math_property: null, - math_group_type_index: null, - properties: { - type: 'AND', - values: [ - { - key: '$current_url', - operator: 'exact', - type: 'event', - value: 'https://hedgebox.net/signup/', - }, - ], - }, - }, - { - id: 'signed_up', - type: 'events', - order: 1, - name: 'signed_up', - custom_name: null, - math: null, - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - filter_test_accounts: true, - funnel_viz_type: FunnelVizType.Steps, - funnel_window_interval: 14, - funnel_window_interval_unit: FunnelConversionWindowTimeUnit.Day, - insight: InsightType.FUNNELS, - interval: 'day', - limit: 100, - smoothing_intervals: 1, - sampling_factor: 0.1, - } as FunnelsFilterType, - significance_code: SignificanceCode.NotEnoughExposure, - expected_loss: 1, - variants: [ - { - key: 'control', - success_count: 31, - failure_count: 38, - }, - { - key: 'test', - success_count: 43, - failure_count: 28, - }, - ], - credible_intervals: { - control: [0.0126, 0.0526], - test: [0.0526, 0.0826], - }, - }, -} - -const MOCK_TREND_EXPERIMENT_RESULTS: TrendsExperimentResults = { - result: { - fakeInsightId: '1234', - insight: [ - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: undefined, - }, - aggregated_value: 0, - label: '$pageview - test', - count: 26, - data: [2.5416666666666, 4.5416666666665, 3.5416666665, 1.666666666665, 8.366666665], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'test', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - date_to: '2023-02-16T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: null, - properties: undefined, - }, - aggregated_value: 0, - label: '$pageview - control', - count: 11.421053, - data: [ - 2.4210526315789473, 1.4210526315789473, 3.4210526315789473, 0.4210526315789473, 3.4210526315789473, - ], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'control', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - ], - probability: { - control: 0.407580005, - test: 0.59242, - }, - significant: false, - filters: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - exposure_filters: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - math: 'dau', - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test'], - }, - ], - }, - significance_code: SignificanceCode.NotEnoughExposure, - p_value: 1, - variants: [ - { - key: 'control', - count: 46, - exposure: 1, - absolute_exposure: 19, - }, - { - key: 'test', - count: 61, - exposure: 1.263157894736842, - absolute_exposure: 24, - }, - ], - credible_intervals: { - control: [1.5678, 3.8765], - test: [1.2345, 3.4567], - }, - }, - last_refresh: '2023-02-11T10:37:17.634000Z', - is_cached: true, -} - -const MOCK_TREND_EXPERIMENT_MANY_VARIANTS_RESULTS: TrendsExperimentResults = { - result: { - fakeInsightId: '12345', - insight: [ - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: undefined, - }, - aggregated_value: 0, - label: '$pageview - test_1', - count: 26, - data: [2.5416666666666, 4.5416666666665, 3.5416666665, 1.666666666665, 8.366666665], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'test_1', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - date_to: '2023-02-16T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: undefined, - }, - aggregated_value: 0, - label: '$pageview - test_2', - count: 26, - data: [3.5416666666666, 5.5416666666665, 4.5416666665, 2.666666666665, 9.366666665], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'test_2', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - date_to: '2023-02-16T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: undefined, - }, - aggregated_value: 0, - label: '$pageview - test_3', - count: 26, - data: [1.8416666666666, 3.7416666666665, 2.2416666665, 1.166666666665, 8.866666665], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'test_3', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - date_to: '2023-02-16T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: undefined, - }, - aggregated_value: 0, - label: '$pageview - test_4', - count: 26, - data: [4.5416666666666, 6.5416666666665, 5.5416666665, 3.666666666665, 10.366666665], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'test_4', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - date_to: '2023-02-16T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: undefined, - }, - aggregated_value: 0, - label: '$pageview - test_5', - count: 26, - data: [0.5416666666666, 2.5416666666665, 1.5416666665, 0.666666666665, 5.366666665], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'test_5', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - date_to: '2023-02-16T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - { - action: { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: undefined, - math_group_type_index: null, - properties: undefined, - }, - aggregated_value: 0, - label: '$pageview - control', - count: 11.421053, - data: [ - 2.8210526315789473, 2.4210526315789473, 1.4210526315789473, 1.4210526315789473, 2.4210526315789473, - ], - labels: ['11-Feb-2023', '12-Feb-2023', '13-Feb-2023', '14-Feb-2023', '15-Feb-2023'], - days: ['2023-02-11', '2023-02-12', '2023-02-13', '2023-02-14', '2023-02-15'], - breakdown_value: 'control', - persons_urls: [ - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - { - url: 'api/projects/1/persons/trends/?breakdown=%24feature%2Faloha&breakdown_attribution_type=first_touch&breakdown_normalize_url=False&breakdown_type=event&date_from=2023-05-19T00%3A00%3A00%2B00%3A00&explicit_date=true&display=ActionsLineGraph&events=%5B%7B%22id%22%3A+%22%24pageview%22%2C+%22type%22%3A+%22events%22%2C+%22order%22%3A+0%2C+%22name%22%3A+%22%24pageview%22%2C+%22custom_name%22%3A+null%2C+%22math%22%3A+%22avg_count_per_actor%22%2C+%22math_property%22%3A+null%2C+%22math_group_type_index%22%3A+null%2C+%22properties%22%3A+%7B%7D%7D%5D&insight=TRENDS&interval=day&properties=%7B%22type%22%3A+%22AND%22%2C+%22values%22%3A+%5B%7B%22key%22%3A+%22%24feature%2Faloha%22%2C+%22operator%22%3A+%22exact%22%2C+%22type%22%3A+%22event%22%2C+%22value%22%3A+%5B%22control%22%2C+%22test%22%5D%7D%5D%7D&sampling_factor=&smoothing_intervals=1&entity_id=%24pageview&entity_type=events&entity_math=avg_count_per_actor&date_to=2023-05-19T00%3A00%3A00%2B00%3A00&breakdown_value=control&cache_invalidation_key=iaDd6ork', - }, - ], - filter: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - }, - ], - probability: { - control: 0.407580005, - test_1: 0.59242, - test_2: 0.49242, - test_3: 0.29242, - test_4: 0.19242, - test_5: 0.09242, - }, - significant: false, - filters: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - custom_name: null, - math: 'avg_count_per_actor', - math_property: null, - math_group_type_index: null, - properties: {}, - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - sampling_factor: undefined, - smoothing_intervals: 1, - }, - exposure_filters: { - breakdown: '$feature/aloha', - breakdown_normalize_url: false, - breakdown_type: 'event', - date_from: '2023-02-11T10:37:17.634000Z', - explicit_date: 'true', - display: ChartDisplayType.ActionsLineGraph, - events: [ - { - id: '$pageview', - type: 'events', - order: 0, - name: '$pageview', - math: 'dau', - }, - ], - insight: InsightType.TRENDS, - interval: 'day', - properties: [ - { - key: '$feature/aloha', - operator: PropertyOperator.Exact, - type: PropertyFilterType.Event, - value: ['control', 'test_1', 'test_2', 'test_3', 'test_4', 'test_5'], - }, - ], - }, - significance_code: SignificanceCode.NotEnoughExposure, - p_value: 1, - variants: [ - { - key: 'control', - count: 46, - exposure: 1, - absolute_exposure: 19, - }, - { - key: 'test_1', - count: 63, - exposure: 1.263157894736842, - absolute_exposure: 24, - }, - { - key: 'test_2', - count: 21, - exposure: 5.463157894736842, - absolute_exposure: 34, - }, - { - key: 'test_3', - count: 31, - exposure: 4.463157894736842, - absolute_exposure: 44, - }, - { - key: 'test_4', - count: 41, - exposure: 3.463157894736842, - absolute_exposure: 54, - }, - { - key: 'test_5', - count: 51, - exposure: 2.463157894736842, - absolute_exposure: 64, - }, - ], - credible_intervals: { - control: [1.5678, 3.8765], - test_1: [1.2345, 3.4567], - test_2: [1.3345, 3.5567], - test_3: [1.4345, 3.5567], - test_4: [1.5345, 3.5567], - test_5: [1.6345, 3.6567], - }, - }, - last_refresh: '2023-02-11T10:37:17.634000Z', - is_cached: true, -} - -const meta: Meta = { - title: 'Scenes-App/Experiments', - parameters: { - layout: 'fullscreen', - viewMode: 'story', - mockDate: '2023-02-15', // To stabilize relative dates - }, - decorators: [ - mswDecorator({ - get: { - '/api/projects/:team_id/experiments/': toPaginatedResponse([ - MOCK_FUNNEL_EXPERIMENT, - MOCK_TREND_EXPERIMENT, - MOCK_TREND_EXPERIMENT_MANY_VARIANTS, - MOCK_WEB_EXPERIMENT_MANY_VARIANTS, - ]), - '/api/projects/:team_id/experiments/1/': MOCK_FUNNEL_EXPERIMENT, - '/api/projects/:team_id/experiments/1/results/': MOCK_EXPERIMENT_RESULTS, - '/api/projects/:team_id/experiments/2/': MOCK_TREND_EXPERIMENT, - '/api/projects/:team_id/experiments/2/results/': MOCK_TREND_EXPERIMENT_RESULTS, - '/api/projects/:team_id/experiments/3/': MOCK_TREND_EXPERIMENT_MANY_VARIANTS, - '/api/projects/:team_id/experiments/3/results/': MOCK_TREND_EXPERIMENT_MANY_VARIANTS_RESULTS, - '/api/projects/:team_id/experiments/4/': MOCK_WEB_EXPERIMENT_MANY_VARIANTS, - '/api/projects/:team_id/experiments/4/results/': MOCK_TREND_EXPERIMENT_MANY_VARIANTS_RESULTS, - }, - }), - ], -} -export default meta -export const ExperimentsList: StoryFn = () => { - useEffect(() => { - router.actions.push(urls.experiments()) - }, []) - return -} - -export const CompleteFunnelExperiment: StoryFn = () => { - useEffect(() => { - router.actions.push(urls.experiment(MOCK_FUNNEL_EXPERIMENT.id)) - }, []) - return -} -CompleteFunnelExperiment.parameters = { - testOptions: { - waitForSelector: '.card-secondary', - }, -} - -export const RunningTrendExperiment: StoryFn = () => { - useEffect(() => { - router.actions.push(urls.experiment(MOCK_TREND_EXPERIMENT.id)) - }, []) - - return -} -RunningTrendExperiment.parameters = { - testOptions: { - waitForSelector: '.LemonBanner .LemonIcon', - }, -} - -export const RunningTrendExperimentManyVariants: StoryFn = () => { - useEffect(() => { - router.actions.push(urls.experiment(MOCK_TREND_EXPERIMENT_MANY_VARIANTS.id)) - }, []) - - return -} -RunningTrendExperimentManyVariants.parameters = { - testOptions: { - waitForSelector: '.LemonBanner .LemonIcon', - }, -} - -export const ExperimentNotFound: StoryFn = () => { - useEffect(() => { - router.actions.push(urls.experiment('1200000')) - }, []) - return -} diff --git a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx index caee718efb726..d34901f9716a1 100644 --- a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx +++ b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx @@ -23,12 +23,11 @@ import { VariantScreenshot } from './VariantScreenshot' export function DistributionModal({ experimentId }: { experimentId: Experiment['id'] }): JSX.Element { const { experiment, experimentLoading, isDistributionModalOpen } = useValues(experimentLogic({ experimentId })) - const { closeDistributionModal, updateExperiment } = useActions(experimentLogic({ experimentId })) + const { closeDistributionModal, updateDistributionModal } = useActions(experimentLogic({ experimentId })) const _featureFlagLogic = featureFlagLogic({ id: experiment.feature_flag?.id ?? null } as FeatureFlagLogicProps) const { featureFlag, areVariantRolloutsValid, variantRolloutSum } = useValues(_featureFlagLogic) - const { setFeatureFlagFilters, distributeVariantsEqually, saveSidebarExperimentFeatureFlag } = - useActions(_featureFlagLogic) + const { setFeatureFlagFilters, distributeVariantsEqually } = useActions(_featureFlagLogic) const handleRolloutPercentageChange = (index: number, value: number | undefined): void => { if (!featureFlag?.filters?.multivariate || !value) { @@ -61,13 +60,7 @@ export function DistributionModal({ experimentId }: { experimentId: Experiment[' { - saveSidebarExperimentFeatureFlag(featureFlag) - updateExperiment({ - holdout_id: experiment.holdout_id, - parameters: { - feature_flag_variants: featureFlag?.filters?.multivariate?.variants ?? [], - }, - }) + updateDistributionModal(featureFlag) closeDistributionModal() }} type="primary" diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsx index 42f6b2cd37652..c8325ab3b7cf5 100644 --- a/frontend/src/scenes/experiments/experimentLogic.tsx +++ b/frontend/src/scenes/experiments/experimentLogic.tsx @@ -10,7 +10,12 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast' import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { hasFormErrors, toParams } from 'lib/utils' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' +import { + indexToVariantKeyFeatureFlagPayloads, + variantKeyToIndexFeatureFlagPayloads, +} from 'scenes/feature-flags/featureFlagLogic' import { validateFeatureFlagKey } from 'scenes/feature-flags/featureFlagLogic' +import { featureFlagsLogic } from 'scenes/feature-flags/featureFlagsLogic' import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic' import { insightDataLogic } from 'scenes/insights/insightDataLogic' import { cleanFilters, getDefaultEvent } from 'scenes/insights/utils/cleanFilters' @@ -165,6 +170,8 @@ export const experimentLogic = kea([ ], teamLogic, ['addProductIntent'], + featureFlagsLogic, + ['updateFlag'], ], })), actions({ @@ -262,6 +269,7 @@ export const experimentLogic = kea([ openPrimaryMetricModal: (index: number) => ({ index }), closePrimaryMetricModal: true, setPrimaryMetricsResultErrors: (errors: any[]) => ({ errors }), + updateDistributionModal: (featureFlag: FeatureFlagType) => ({ featureFlag }), }), reducers({ experiment: [ @@ -795,6 +803,23 @@ export const experimentLogic = kea([ lemonToast.error('Failed to update experiment variant images') } }, + updateDistributionModal: async ({ featureFlag }) => { + const { created_at, id, ...flag } = featureFlag + + const preparedFlag = indexToVariantKeyFeatureFlagPayloads(flag) + + const savedFlag = await api.update( + `api/projects/${values.currentProjectId}/feature_flags/${id}`, + preparedFlag + ) + + const updatedFlag = variantKeyToIndexFeatureFlagPayloads(savedFlag) + actions.updateFlag(updatedFlag) + + actions.updateExperiment({ + holdout_id: values.experiment.holdout_id, + }) + }, })), loaders(({ actions, props, values }) => ({ experiment: { @@ -1501,7 +1526,7 @@ export const experimentLogic = kea([ } const variantsWithResults: TabularSecondaryMetricResults[] = [] - experiment?.parameters?.feature_flag_variants?.forEach((variant) => { + experiment?.feature_flag?.filters?.multivariate?.variants?.forEach((variant) => { const metricResults: SecondaryMetricResult[] = [] experiment?.secondary_metrics?.forEach((metric, idx) => { let result diff --git a/frontend/src/scenes/feature-flags/featureFlagLogic.ts b/frontend/src/scenes/feature-flags/featureFlagLogic.ts index 4a9fd05113d3e..41eac1ddc740b 100644 --- a/frontend/src/scenes/feature-flags/featureFlagLogic.ts +++ b/frontend/src/scenes/feature-flags/featureFlagLogic.ts @@ -154,7 +154,7 @@ export const variantKeyToIndexFeatureFlagPayloads = (flag: FeatureFlagType): Fea } } -const indexToVariantKeyFeatureFlagPayloads = (flag: Partial): Partial => { +export const indexToVariantKeyFeatureFlagPayloads = (flag: Partial): Partial => { if (flag.filters?.multivariate) { const newPayloads: Record = {} flag.filters.multivariate.variants.forEach(({ key }, index) => { diff --git a/frontend/src/scenes/settings/environment/ReplayTriggers.tsx b/frontend/src/scenes/settings/environment/ReplayTriggers.tsx index 48e79bea18cec..495387c5146ec 100644 --- a/frontend/src/scenes/settings/environment/ReplayTriggers.tsx +++ b/frontend/src/scenes/settings/environment/ReplayTriggers.tsx @@ -202,8 +202,8 @@ function UrlBlocklistOptions(): JSX.Element | null { return ( list[AnyPropertyFilter]: prop_filters: list[AnyPropertyFilter] = [] for prop in self._team.test_account_filters: - match prop["type"]: + match prop.get("type", None): case "person": prop_filters.append(PersonPropertyFilter(**prop)) case "event": @@ -191,6 +191,9 @@ def _test_account_filters(self) -> list[AnyPropertyFilter]: prop_filters.append(GroupPropertyFilter(**prop)) case "hogql": prop_filters.append(HogQLPropertyFilter(**prop)) + case None: + logger.warn("test account filter had no type", filter=prop) + prop_filters.append(EventPropertyFilter(**prop)) return prop_filters diff --git a/posthog/session_recordings/queries/test/test_session_recording_list_from_query.py b/posthog/session_recordings/queries/test/test_session_recording_list_from_query.py index 35116f4085e55..2acf2a47d5642 100644 --- a/posthog/session_recordings/queries/test/test_session_recording_list_from_query.py +++ b/posthog/session_recordings/queries/test/test_session_recording_list_from_query.py @@ -3316,7 +3316,9 @@ def test_event_filter_with_test_accounts_excluded(self): "key": "is_internal_user", "value": ["false"], "operator": "exact", - "type": "event", + # in production some test account filters don't include type + # we default to event in that case + # "type": "event", }, {"key": "properties.$browser == 'Chrome'", "type": "hogql"}, ] diff --git a/posthog/settings/web.py b/posthog/settings/web.py index 05dd38af055a9..7119ca67f51b5 100644 --- a/posthog/settings/web.py +++ b/posthog/settings/web.py @@ -123,8 +123,6 @@ ] if DEBUG: - # Used on local devenv to reverse-proxy all of /i/* to capture-rs on port 3000 - INSTALLED_APPS.append("revproxy") # rebase_migration command INSTALLED_APPS.append("django_linear_migrations") diff --git a/posthog/urls.py b/posthog/urls.py index 9a1f46757e892..d73c2271ef73f 100644 --- a/posthog/urls.py +++ b/posthog/urls.py @@ -19,7 +19,7 @@ SpectacularRedocView, SpectacularSwaggerView, ) -from revproxy.views import ProxyView + from sentry_sdk import last_event_id from two_factor.urls import urlpatterns as tf_urls @@ -248,9 +248,6 @@ def opt_slash_path(route: str, view: Callable, name: Optional[str] = None) -> UR # what we do. urlpatterns.append(path("_metrics", ExportToDjangoView)) - # Reverse-proxy all of /i/* to capture-rs on port 3000 when running the local devenv - urlpatterns.append(re_path(r"(?P^i/.*)", ProxyView.as_view(upstream="http://localhost:3000"))) - if settings.TEST: # Used in posthog-js e2e tests diff --git a/requirements-dev.txt b/requirements-dev.txt index cc0e410715cd7..d005fd81fb9f7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -167,10 +167,6 @@ googleapis-common-protos==1.60.0 # via # -c requirements.txt # opentelemetry-exporter-otlp-proto-grpc -greenlet==3.1.1 - # via - # -c requirements.txt - # sqlalchemy grpcio==1.63.2 # via # -c requirements.txt diff --git a/requirements.in b/requirements.in index 1c1a0d4db454c..c4564b0f1ecaf 100644 --- a/requirements.in +++ b/requirements.in @@ -30,7 +30,6 @@ django-prometheus==2.2.0 django-redis==5.2.0 django-statsd==2.5.2 django-structlog==2.1.3 -django-revproxy==0.12.0 djangorestframework==3.15.1 djangorestframework-csv==2.1.1 djangorestframework-dataclasses==1.2.0 diff --git a/requirements.txt b/requirements.txt index 02687dd067071..ec758cf47f4ca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -157,7 +157,6 @@ django==4.2.15 # django-phonenumber-field # django-picklefield # django-redis - # django-revproxy # django-structlog # django-two-factor-auth # djangorestframework @@ -192,8 +191,6 @@ django-prometheus==2.2.0 # via -r requirements.in django-redis==5.2.0 # via -r requirements.in -django-revproxy==0.12.0 - # via -r requirements.in django-statsd==2.5.2 # via -r requirements.in django-structlog==2.1.3 @@ -779,7 +776,6 @@ uritemplate==4.1.1 urllib3==1.26.18 # via # botocore - # django-revproxy # geoip2 # google-auth # pdpyras