From c3407907631df38ec6cdaa023c755c0f726ce792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Oberm=C3=BCller?= Date: Fri, 15 Mar 2024 10:29:50 +0100 Subject: [PATCH] fix(hogql): fix schema for empty time-to-convert results (#20944) --- frontend/src/queries/schema.json | 2 +- frontend/src/queries/schema.ts | 2 +- posthog/schema.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index 7a57435114500..843fa033737a2 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -1960,7 +1960,7 @@ "additionalProperties": false, "properties": { "average_conversion_time": { - "type": "number" + "type": ["number", "null"] }, "bins": { "items": { diff --git a/frontend/src/queries/schema.ts b/frontend/src/queries/schema.ts index ce38af15470cd..64de744e22d71 100644 --- a/frontend/src/queries/schema.ts +++ b/frontend/src/queries/schema.ts @@ -713,7 +713,7 @@ type BinNumber = number export type FunnelStepsResults = Record[] export type FunnelStepsBreakdownResults = Record[][] export type FunnelTimeToConvertResults = { - average_conversion_time: number + average_conversion_time: number | null bins: [BinNumber, BinNumber][] } export type FunnelTrendsResults = Record[] diff --git a/posthog/schema.py b/posthog/schema.py index 2041f8cbdec2c..5041c7f582ffe 100644 --- a/posthog/schema.py +++ b/posthog/schema.py @@ -355,7 +355,7 @@ class FunnelTimeToConvertResults(BaseModel): model_config = ConfigDict( extra="forbid", ) - average_conversion_time: float + average_conversion_time: Optional[float] = None bins: List[List[int]]