From c8b04cd0ac4252beb339eb12fb3557b335f242c1 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Wed, 11 Dec 2024 13:19:07 -0800 Subject: [PATCH] fix(experiments): Allow `stats_version` to be optional (#26850) --- frontend/src/queries/schema.json | 5 ----- frontend/src/queries/schema.ts | 2 +- posthog/schema.py | 10 +++++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index 7337e86b5f1b6..c2d5aadc147bb 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -2279,7 +2279,6 @@ "probability", "significance_code", "significant", - "stats_version", "timezone", "variants" ], @@ -4615,7 +4614,6 @@ "probability", "significance_code", "significant", - "stats_version", "variants" ], "type": "object" @@ -6176,7 +6174,6 @@ "probability", "significant", "significance_code", - "stats_version", "p_value", "credible_intervals" ], @@ -9895,7 +9892,6 @@ "probability", "significant", "significance_code", - "stats_version", "p_value", "credible_intervals" ], @@ -10528,7 +10524,6 @@ "probability", "significance_code", "significant", - "stats_version", "variants" ], "type": "object" diff --git a/frontend/src/queries/schema.ts b/frontend/src/queries/schema.ts index 8171185712d97..9f8f101449564 100644 --- a/frontend/src/queries/schema.ts +++ b/frontend/src/queries/schema.ts @@ -2007,7 +2007,7 @@ export interface ExperimentTrendsQueryResponse { probability: Record significant: boolean significance_code: ExperimentSignificanceCode - stats_version: integer + stats_version?: integer p_value: number credible_intervals: Record } diff --git a/posthog/schema.py b/posthog/schema.py index d81b33c913ce2..4bc3d81952e91 100644 --- a/posthog/schema.py +++ b/posthog/schema.py @@ -5893,7 +5893,7 @@ class CachedExperimentTrendsQueryResponse(BaseModel): ) significance_code: ExperimentSignificanceCode significant: bool - stats_version: int + stats_version: Optional[int] = None timezone: str variants: list[ExperimentVariantTrendsBaseStats] @@ -5911,7 +5911,7 @@ class Response10(BaseModel): probability: dict[str, float] significance_code: ExperimentSignificanceCode significant: bool - stats_version: int + stats_version: Optional[int] = None variants: list[ExperimentVariantTrendsBaseStats] @@ -6016,7 +6016,7 @@ class ExperimentTrendsQueryResponse(BaseModel): probability: dict[str, float] significance_code: ExperimentSignificanceCode significant: bool - stats_version: int + stats_version: Optional[int] = None variants: list[ExperimentVariantTrendsBaseStats] @@ -6345,7 +6345,7 @@ class QueryResponseAlternative16(BaseModel): probability: dict[str, float] significance_code: ExperimentSignificanceCode significant: bool - stats_version: int + stats_version: Optional[int] = None variants: list[ExperimentVariantTrendsBaseStats] @@ -6377,7 +6377,7 @@ class QueryResponseAlternative27(BaseModel): probability: dict[str, float] significance_code: ExperimentSignificanceCode significant: bool - stats_version: int + stats_version: Optional[int] = None variants: list[ExperimentVariantTrendsBaseStats]