From bbacbc5fad32aade390d00885fa2b7f20472a55f Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Mon, 18 Nov 2024 09:45:11 -0800 Subject: [PATCH] feat(insights): Support HogQL for data warehouse filters (#26245) --- .../ActionFilterRow/ActionFilterRow.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx index b4d3fc16421..15586e766a3 100644 --- a/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx +++ b/frontend/src/scenes/insights/filters/ActionFilter/ActionFilterRow/ActionFilterRow.tsx @@ -40,6 +40,7 @@ import { } from 'scenes/trends/mathsLogic' import { actionsModel } from '~/models/actionsModel' +import { NodeKind } from '~/queries/schema' import { isInsightVizNode, isStickinessQuery } from '~/queries/utils' import { ActionFilter, @@ -596,9 +597,20 @@ export function ActionFilterRow({ onChange={(properties) => updateFilterProperty({ properties, index })} showNestedArrow={showNestedArrow} disablePopover={!propertyFiltersPopover} + metadataSource={ + filter.type == TaxonomicFilterGroupType.DataWarehouse + ? { + kind: NodeKind.HogQLQuery, + query: `select ${filter.distinct_id_field} from ${filter.table_name}`, + } + : undefined + } taxonomicGroupTypes={ filter.type == TaxonomicFilterGroupType.DataWarehouse - ? [TaxonomicFilterGroupType.DataWarehouseProperties] + ? [ + TaxonomicFilterGroupType.DataWarehouseProperties, + TaxonomicFilterGroupType.HogQLExpression, + ] : propertiesTaxonomicGroupTypes } eventNames={