From 75ec240130a0abece0b4ea6e96d817e1cd7fce33 Mon Sep 17 00:00:00 2001 From: Julian Bez Date: Thu, 25 Jul 2024 10:30:20 +0100 Subject: [PATCH] feat(insights): Make initial single insight load async (#23808) Co-authored-by: Michael Matloka Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- frontend/src/lib/api.ts | 6 +- .../queries/nodes/DataNode/dataNodeLogic.ts | 11 +- frontend/src/queries/schema.json | 196 ++++++++++++++++++ frontend/src/queries/schema.ts | 5 + frontend/src/scenes/insights/insightLogic.ts | 3 +- posthog/schema.py | 141 +++++++++++++ 6 files changed, 355 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 6bb3b9159b040..4c98183a2acb6 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -895,14 +895,16 @@ const api = { insights: { loadInsight( shortId: InsightModel['short_id'], - basic?: boolean + basic?: boolean, + refresh?: RefreshType ): Promise>> { return new ApiRequest() .insights() .withQueryString( toParams({ short_id: encodeURIComponent(shortId), - basic: basic, + basic, + refresh, }) ) .get() diff --git a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts b/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts index 307969e842621..b00903d970b17 100644 --- a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts +++ b/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts @@ -128,7 +128,11 @@ export const dataNodeLogic = kea([ if (oldProps.query?.kind && props.query.kind !== oldProps.query.kind) { actions.clearResponse() } - if ( + const queryStatus = (props.cachedResults?.query_status || null) as QueryStatus | null + if (queryStatus?.complete === false) { + // If there is an incomplete query, load the data with the same query_id which should return its status + actions.loadData(undefined, queryStatus.id) + } else if ( !(props.cachedResults && props.key.includes('dashboard')) && // Don't load data on dashboard if cached results are available !queryEqual(props.query, oldProps.query) && (!props.cachedResults || @@ -141,7 +145,7 @@ export const dataNodeLogic = kea([ } }), actions({ - loadData: (refresh = false) => ({ refresh, queryId: uuid() }), + loadData: (refresh = false, queryId?: string) => ({ refresh, queryId: queryId || uuid() }), abortAnyRunningQuery: true, abortQuery: (payload: { queryId: string }) => payload, cancelQuery: true, @@ -166,7 +170,8 @@ export const dataNodeLogic = kea([ return props.cachedResults } - if (props.cachedResults && !refresh) { + const queryStatus = (props.cachedResults?.query_status || null) as QueryStatus | null + if (props.cachedResults && !refresh && queryStatus?.complete !== false) { if (props.cachedResults['result'] || props.cachedResults['results']) { return props.cachedResults } diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index 20afa26306c9d..aee56d22a990f 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -151,6 +151,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -2180,6 +2184,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -2235,6 +2243,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -2307,6 +2319,10 @@ "description": "Input query string", "type": "string" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -2348,6 +2364,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/WebOverviewItem" @@ -2396,6 +2416,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -2437,6 +2461,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -2487,6 +2515,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": {}, "timings": { "description": "Measured timings for different parts of the query generation process", @@ -2533,6 +2565,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/ErrorTrackingGroup" @@ -3403,6 +3439,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/ErrorTrackingGroup" @@ -3741,6 +3781,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -3911,6 +3955,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "$ref": "#/definitions/FunnelCorrelationResult" }, @@ -4454,6 +4502,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "anyOf": [ { @@ -4929,6 +4981,10 @@ "description": "Input query string", "type": "string" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -5729,6 +5785,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -6045,6 +6105,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -6295,6 +6359,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -6350,6 +6418,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -6501,6 +6573,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/TimelineEntry" @@ -6585,6 +6661,10 @@ "description": "Input query string", "type": "string" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -6684,6 +6764,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/WebOverviewItem" @@ -6732,6 +6816,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -6773,6 +6861,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -6823,6 +6915,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": {}, "timings": { "description": "Measured timings for different parts of the query generation process", @@ -6869,6 +6965,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/ErrorTrackingGroup" @@ -6921,6 +7021,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -6976,6 +7080,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "items": {}, @@ -7048,6 +7156,10 @@ "description": "Input query string", "type": "string" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -7089,6 +7201,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/WebOverviewItem" @@ -7137,6 +7253,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -7178,6 +7298,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -7228,6 +7352,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": {}, "timings": { "description": "Measured timings for different parts of the query generation process", @@ -7274,6 +7402,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/ErrorTrackingGroup" @@ -7306,6 +7438,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -7338,6 +7474,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "anyOf": [ { @@ -7380,6 +7520,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/RetentionResult" @@ -7412,6 +7556,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -7444,6 +7592,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -7476,6 +7628,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -7521,6 +7677,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "$ref": "#/definitions/FunnelCorrelationResult" }, @@ -7979,6 +8139,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/RetentionResult" @@ -8254,6 +8418,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": {}, "timings": { "description": "Measured timings for different parts of the query generation process", @@ -8345,6 +8513,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/TimelineEntry" @@ -8503,6 +8675,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -8570,6 +8746,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -8886,6 +9066,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "type": "object" @@ -9049,6 +9233,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": { "$ref": "#/definitions/WebOverviewItem" @@ -9177,6 +9365,10 @@ "offset": { "type": "integer" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" @@ -9261,6 +9453,10 @@ "$ref": "#/definitions/HogQLQueryModifiers", "description": "Modifiers used when performing the query" }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, "results": { "items": {}, "type": "array" diff --git a/frontend/src/queries/schema.ts b/frontend/src/queries/schema.ts index 924bc2bc0ee7e..46e7c12c82d87 100644 --- a/frontend/src/queries/schema.ts +++ b/frontend/src/queries/schema.ts @@ -255,6 +255,7 @@ export interface HogQueryResponse { bytecode?: any[] coloredBytecode?: any[] stdout?: string + query_status?: never } export interface HogQuery extends DataNode { @@ -276,6 +277,7 @@ export interface HogQLMetadataResponse { errors: HogQLNotice[] warnings: HogQLNotice[] notices: HogQLNotice[] + query_status?: never } export interface AutocompleteCompletionItem { @@ -340,6 +342,7 @@ export interface HogQLAutocompleteResponse { incomplete_list: boolean /** Measured timings for different parts of the query generation process */ timings?: QueryTiming[] + query_status?: never } export enum HogLanguage { @@ -1010,6 +1013,8 @@ export interface AnalyticsQueryResponseBase { error?: string /** Modifiers used when performing the query */ modifiers?: HogQLQueryModifiers + /** Query status indicates whether next to the provided data, a query is still running. */ + query_status?: QueryStatus } interface CachedQueryResponseMixin { diff --git a/frontend/src/scenes/insights/insightLogic.ts b/frontend/src/scenes/insights/insightLogic.ts index 036b501f42f91..5a1e25ade460f 100644 --- a/frontend/src/scenes/insights/insightLogic.ts +++ b/frontend/src/scenes/insights/insightLogic.ts @@ -119,8 +119,7 @@ export const insightLogic = kea([ { loadInsight: async ({ shortId }, breakpoint) => { await breakpoint(100) - const response = await api.insights.loadInsight(shortId) - + const response = await api.insights.loadInsight(shortId, undefined, 'async') if (response?.results?.[0]) { return response.results[0] } diff --git a/posthog/schema.py b/posthog/schema.py index cd957832fd843..45d6311418d07 100644 --- a/posthog/schema.py +++ b/posthog/schema.py @@ -955,6 +955,9 @@ class SessionAttributionExplorerQueryResponse(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: Any timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1023,6 +1026,9 @@ class StickinessQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[dict[str, Any]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1073,6 +1079,9 @@ class TestBasicQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1177,6 +1186,9 @@ class TrendsQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[dict[str, Any]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1248,6 +1260,9 @@ class WebOverviewQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[WebOverviewItem] samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -1291,6 +1306,9 @@ class WebStatsTableQueryResponse(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -1312,6 +1330,9 @@ class WebTopClicksQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -1337,6 +1358,9 @@ class ActorsQueryResponse(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1859,6 +1883,9 @@ class Response(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1883,6 +1910,9 @@ class Response1(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1904,6 +1934,9 @@ class Response3(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[WebOverviewItem] samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -1927,6 +1960,9 @@ class Response4(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -1948,6 +1984,9 @@ class Response5(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -1972,6 +2011,9 @@ class Response6(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: Any timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -1995,6 +2037,9 @@ class Response7(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[ErrorTrackingGroup] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2092,6 +2137,9 @@ class ErrorTrackingQueryResponse(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[ErrorTrackingGroup] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2125,6 +2173,9 @@ class EventsQueryResponse(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2159,6 +2210,9 @@ class FunnelCorrelationResponse(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: FunnelCorrelationResult timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2198,6 +2252,9 @@ class FunnelsQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: Union[FunnelTimeToConvertResults, list[dict[str, Any]], list[list[dict[str, Any]]]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2284,6 +2341,9 @@ class HogQLQueryResponse(BaseModel): ) offset: Optional[int] = None query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2345,6 +2405,9 @@ class LifecycleQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[dict[str, Any]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2370,6 +2433,9 @@ class PathsQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[dict[str, Any]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2403,6 +2469,9 @@ class QueryResponseAlternative1(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2427,6 +2496,9 @@ class QueryResponseAlternative2(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2460,6 +2532,9 @@ class QueryResponseAlternative4(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[TimelineEntry] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2486,6 +2561,9 @@ class QueryResponseAlternative6(BaseModel): ) offset: Optional[int] = None query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2518,6 +2596,9 @@ class QueryResponseAlternative9(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[WebOverviewItem] samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -2541,6 +2622,9 @@ class QueryResponseAlternative10(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -2562,6 +2646,9 @@ class QueryResponseAlternative11(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -2586,6 +2673,9 @@ class QueryResponseAlternative12(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: Any timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2609,6 +2699,9 @@ class QueryResponseAlternative13(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[ErrorTrackingGroup] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2631,6 +2724,9 @@ class QueryResponseAlternative14(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2655,6 +2751,9 @@ class QueryResponseAlternative15(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[list] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2682,6 +2781,9 @@ class QueryResponseAlternative16(BaseModel): ) offset: Optional[int] = None query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2703,6 +2805,9 @@ class QueryResponseAlternative17(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[WebOverviewItem] samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -2726,6 +2831,9 @@ class QueryResponseAlternative18(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -2747,6 +2855,9 @@ class QueryResponseAlternative19(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list samplingRate: Optional[SamplingRate] = None timings: Optional[list[QueryTiming]] = Field( @@ -2771,6 +2882,9 @@ class QueryResponseAlternative20(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: Any timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2794,6 +2908,9 @@ class QueryResponseAlternative21(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[ErrorTrackingGroup] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2812,6 +2929,9 @@ class QueryResponseAlternative22(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[dict[str, Any]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2830,6 +2950,9 @@ class QueryResponseAlternative23(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: Union[FunnelTimeToConvertResults, list[dict[str, Any]], list[list[dict[str, Any]]]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2848,6 +2971,9 @@ class QueryResponseAlternative25(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[dict[str, Any]] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -2870,6 +2996,9 @@ class QueryResponseAlternative28(BaseModel): default=None, description="Modifiers used when performing the query" ) offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: FunnelCorrelationResult timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -3003,6 +3132,9 @@ class SessionsTimelineQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[TimelineEntry] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -3227,6 +3359,9 @@ class Response2(BaseModel): ) offset: Optional[int] = None query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -3759,6 +3894,9 @@ class QueryResponseAlternative24(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[RetentionResult] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process" @@ -3777,6 +3915,9 @@ class RetentionQueryResponse(BaseModel): modifiers: Optional[HogQLQueryModifiers] = Field( default=None, description="Modifiers used when performing the query" ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) results: list[RetentionResult] timings: Optional[list[QueryTiming]] = Field( default=None, description="Measured timings for different parts of the query generation process"