From 24c867d524cc3a83f0e6c9ccd393c5b8ac937151 Mon Sep 17 00:00:00 2001 From: Robbie Date: Fri, 26 Jan 2024 09:43:43 +0000 Subject: [PATCH] fix(web-analytics): Add more debugging when test filters do not pass validation (#19970) * fix(web-analytics): Add more debugging when test filters do not pass validation * Update test --- posthog/hogql/test/test_property.py | 2 +- posthog/models/property/property.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/posthog/hogql/test/test_property.py b/posthog/hogql/test/test_property.py index 52e57d9c61c76..3b2e582149cc6 100644 --- a/posthog/hogql/test/test_property.py +++ b/posthog/hogql/test/test_property.py @@ -87,7 +87,7 @@ def test_property_to_expr_group(self): self._property_to_expr({"type": "group", "key": "a", "value": "b"}) self.assertEqual( str(e.exception), - "Missing required key group_type_index for property type group", + "Missing required key group_type_index for property type group with name a", ) def test_property_to_expr_event(self): diff --git a/posthog/models/property/property.py b/posthog/models/property/property.py index 31e8425c205d9..2b7a8a558e186 100644 --- a/posthog/models/property/property.py +++ b/posthog/models/property/property.py @@ -255,7 +255,7 @@ def __init__( for key in VALIDATE_PROP_TYPES[self.type]: if getattr(self, key, None) is None: - raise ValueError(f"Missing required key {key} for property type {self.type}") + raise ValueError(f"Missing required key {key} for property type {self.type} with name {self.key}") if self.type == "behavioral": for key in VALIDATE_BEHAVIORAL_PROP_TYPES[cast(BehavioralPropertyType, self.value)]: