0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00

feat(insights): Support HogQL for data warehouse filters (#26245)

This commit is contained in:
Daniel Bachhuber 2024-11-18 09:45:11 -08:00 committed by GitHub
parent ad1e69e18b
commit bbacbc5fad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,6 +40,7 @@ import {
} from 'scenes/trends/mathsLogic' } from 'scenes/trends/mathsLogic'
import { actionsModel } from '~/models/actionsModel' import { actionsModel } from '~/models/actionsModel'
import { NodeKind } from '~/queries/schema'
import { isInsightVizNode, isStickinessQuery } from '~/queries/utils' import { isInsightVizNode, isStickinessQuery } from '~/queries/utils'
import { import {
ActionFilter, ActionFilter,
@ -596,9 +597,20 @@ export function ActionFilterRow({
onChange={(properties) => updateFilterProperty({ properties, index })} onChange={(properties) => updateFilterProperty({ properties, index })}
showNestedArrow={showNestedArrow} showNestedArrow={showNestedArrow}
disablePopover={!propertyFiltersPopover} disablePopover={!propertyFiltersPopover}
metadataSource={
filter.type == TaxonomicFilterGroupType.DataWarehouse
? {
kind: NodeKind.HogQLQuery,
query: `select ${filter.distinct_id_field} from ${filter.table_name}`,
}
: undefined
}
taxonomicGroupTypes={ taxonomicGroupTypes={
filter.type == TaxonomicFilterGroupType.DataWarehouse filter.type == TaxonomicFilterGroupType.DataWarehouse
? [TaxonomicFilterGroupType.DataWarehouseProperties] ? [
TaxonomicFilterGroupType.DataWarehouseProperties,
TaxonomicFilterGroupType.HogQLExpression,
]
: propertiesTaxonomicGroupTypes : propertiesTaxonomicGroupTypes
} }
eventNames={ eventNames={