From 9f52e061eb5bd3d5a4aa86e4f15a1f00393fc362 Mon Sep 17 00:00:00 2001 From: Eric Duong Date: Fri, 15 Mar 2024 12:13:13 -0400 Subject: [PATCH] feat(data-warehouse): virtual data warehouse table (#20888) * create virtual table definition with the shape of events * add conditionals * update schema * add distinct_id field * maths working * add prop math selection * add field * Update UI snapshots for `chromium` (2) * Update UI snapshots for `chromium` (2) * typing * clean up snapshot * cleanup * remove unnecessary * more cleanup * add breakdown * format * typing --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- .../DefinitionPopoverContents.tsx | 17 +- .../TaxonomicPopover/TaxonomicPopover.tsx | 5 +- .../InsightQuery/utils/filtersToQueryNode.ts | 2 + .../InsightQuery/utils/queryNodeToFilter.ts | 7 +- frontend/src/queries/schema.json | 30 +- frontend/src/queries/schema.ts | 9 + frontend/src/scenes/data-warehouse/types.ts | 1 + .../ActionFilterRow/ActionFilterRow.tsx | 10 +- .../filters/ActionFilter/entityFilterLogic.ts | 19 +- frontend/src/types.ts | 1 + posthog/hogql/database/database.py | 28 ++ .../insights/data_warehouse_mixin.py | 14 + .../insights/trends/aggregation_operations.py | 14 +- .../insights/trends/breakdown.py | 1 + .../insights/trends/breakdown_values.py | 15 +- .../data_warehouse_trends_query_builder.py | 409 ------------------ .../test_data_warehouse_query_builder.ambr | 26 -- .../test_trends_data_warehouse_query.ambr | 185 ++++++++ ...py => test_trends_data_warehouse_query.py} | 68 ++- .../insights/trends/trends_query_builder.py | 37 +- .../trends/trends_query_builder_abstract.py | 52 --- .../insights/trends/trends_query_runner.py | 45 +- posthog/schema.py | 12 + 23 files changed, 468 insertions(+), 539 deletions(-) create mode 100644 posthog/hogql_queries/insights/data_warehouse_mixin.py delete mode 100644 posthog/hogql_queries/insights/trends/data_warehouse_trends_query_builder.py create mode 100644 posthog/hogql_queries/insights/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr rename posthog/hogql_queries/insights/trends/test/{test_data_warehouse_query_builder.py => test_trends_data_warehouse_query.py} (81%) delete mode 100644 posthog/hogql_queries/insights/trends/trends_query_builder_abstract.py diff --git a/frontend/src/lib/components/DefinitionPopover/DefinitionPopoverContents.tsx b/frontend/src/lib/components/DefinitionPopover/DefinitionPopoverContents.tsx index e174b688a36f6..1c9e4928ecb22 100644 --- a/frontend/src/lib/components/DefinitionPopover/DefinitionPopoverContents.tsx +++ b/frontend/src/lib/components/DefinitionPopover/DefinitionPopoverContents.tsx @@ -293,7 +293,18 @@ function DefinitionView({ group }: { group: TaxonomicFilterGroup }): JSX.Element onChange={(value) => setLocalDefinition({ id_field: value })} /> -