From c25b571388a9ad05d529a14daee8f49819280496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Oberm=C3=BCller?= Date: Fri, 23 Aug 2024 13:26:59 +0200 Subject: [PATCH] fix(insights): use exclude_none flag for cleaner queries (#24546) --- posthog/models/insight.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/posthog/models/insight.py b/posthog/models/insight.py index 3aad1289892c4..e73c44d90dd2d 100644 --- a/posthog/models/insight.py +++ b/posthog/models/insight.py @@ -124,7 +124,11 @@ def query_from_filters(self): from posthog.hogql_queries.legacy_compatibility.filter_to_query import filter_to_query try: - return {"kind": "InsightVizNode", "source": filter_to_query(self.filters).model_dump(), "full": True} + return { + "kind": "InsightVizNode", + "source": filter_to_query(self.filters).model_dump(exclude_none=True), + "full": True, + } except Exception as e: capture_exception(e)