Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(customer-analytics): gate HogQL-only account columns (#79695)

Arthur Moreira de Deus468c3de12e98
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 309b6ba0afd1..e38e2690a3cb 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -276,6 +276,7 @@ export const FEATURE_FLAGS = {
CREATE_FORM_TOOL: 'phai-create-form-tool', // owner: @kappa90 #team-posthog-ai
CRM_ITERATION_ONE: 'crm-iteration-one', // owner: @arthurdedeus #team-customer-analytics
CUSTOMER_ANALYTICS: 'customer-analytics-roadmap', // owner: @arthurdedeus #team-customer-analytics
+ CUSTOMER_ANALYTICS_ACCOUNTS_HOGQL_CLEANUP: 'customer-analytics-accounts-hogql-cleanup', // owner: @arthurdedeus #team-customer-analytics, hides account columns that require custom HogQL or data warehouse joins
CUSTOMER_ANALYTICS_CSP: 'customer-analytics-csp', // owner: @arthurdedeus #team-customer-analytics, gates the Customer analytics > Accounts settings tab (account_group_type_index dropdown)
CUSTOMER_ANALYTICS_JOURNEYS: 'customer-analytics-journeys', // owner: @arthurdedeus #team-customer-analytics
CUSTOMER_PROFILE_CONFIG_BUTTON: 'customer-profile-config-button', // owner: @arthurdedeus #team-customer-analytics
diff --git a/products/customer_analytics/frontend/components/Accounts/AGENTS.md b/products/customer_analytics/frontend/components/Accounts/AGENTS.md
index d37962edf2b5..de3fe10fdf57 100644
--- a/products/customer_analytics/frontend/components/Accounts/AGENTS.md
+++ b/products/customer_analytics/frontend/components/Accounts/AGENTS.md
@@ -44,7 +44,7 @@ AccountsTabContent ── binds dataNodeLogic(ACCOUNTS_HOGQL_DATA_NODE_KEY, acc
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accountsLogic` | The hub. Search (debounced), tag / assigned-to/unassigned / custom-property filters, sort, inline role assignment, the `hogqlQuery` selector, shareable URL-hash view state, and `openAccount` (the Max entry point). `connect`s column-config, overview-tiles, and expansion logics. |
| `accountsViewsLogic` | Saved-views lifecycle (list/create/update/delete/select). Connects to `accountsLogic`, `accountsColumnConfigLogic`, and `accountsOverviewTilesLogic`; is the single owner of reading and writing the `ColumnConfiguration` rows for this area. |
-| `accountsColumnConfigLogic` | Selected columns (`selectColumns` / `visibleColumnNames`), the column-picker groups built from the DB schema + data-warehouse joins, and the per-team saved column config (`columnConfigurations` API), and the custom-property definitions: it loads them, seeds `propertyDefinitionsModel` (so the filter UI resolves per-type operator sets), and exposes `customPropertyTaxonomicOptions` / `customPropertyDefinitionsById`. |
+| `accountsColumnConfigLogic` | Selected columns (`selectColumns` / `visibleColumnNames`), the column-picker groups built from the DB schema + data-warehouse joins, and the per-team saved column config (`columnConfigurations` API), and the custom-property definitions: it loads them, seeds `propertyDefinitionsModel` (so the filter UI resolves per-type operator sets), and exposes `customPropertyTaxonomicOptions` / `customPropertyDefinitionsById`. When `CUSTOMER_ANALYTICS_ACCOUNTS_HOGQL_CLEANUP` is enabled, the picker only offers Postgres-backed account fields, tags, notes, relationships, and custom properties. |
| `accountsExpansionLogic` | Which rows are expanded (`expandedAccountIds`) and the active tab per account (`activeTabByAccount`). Pure state — no DOM, no data fetching. |
| `accountsOverviewTilesLogic` | The overview metric tiles (saved in views via `properties.tiles`); its `metrics` feed `accountsLogic.metricsQuery`, the separate metrics-only data node (key `ACCOUNTS_METRICS_DATA_NODE_KEY`) it reads `response`/`responseLoading` back from — independent of the list rows. Reads legacy per-team localStorage tiles **read-only** on mount + emits an `OverviewTilesLocalStorageRead` tombstone; never writes localStorage. |
| `accountNotebooksLogic` | Notes/notebooks linked to one account (keyed by `accountId`): server-side pagination (`page`/`notebooksCount`), debounced title+content search (`searchTerm`), sort (`sorting` by created date/author), and `createNote` (creates an internal account notebook and opens it in the side panel). |
@@ -66,7 +66,7 @@ AccountsTabContent ── binds dataNodeLogic(ACCOUNTS_HOGQL_DATA_NODE_KEY, acc
The `tag_names` cell is editable in place: `TagsCell` renders the editable `ObjectTags` variant (available tags from `tagsModel`), saving through the account PATCH via `accountsLogic.updateAccountTags` — optimistic per-account override (`tagOverrides`, masking the stale HogQL cell like `relationshipOverrides`), debounced full-list PATCH (`TAGS_SAVE_DEBOUNCE_MS`, since `ObjectTags` fires per added/removed tag), `savingTags` guard, revert + toast + captured exception on failure. Clicking a tag in the cell adds it to the tags filter, compounding with tags already filtered (`addTagToFilter` — dedupes, and reports through `reportFilterChange('tag')` like the filter control).
-Default columns: `name`, `tag_names`, `notebook_count`, plus one relationship column per team definition. `ACCOUNTS_HOGQL_DEFAULT_SELECT` (base columns only) is just the pre-load seed; once `loadRelationshipDefinitionsSuccess` fires, still-default columns are upgraded to the `defaultSelectColumns` selector (seeded definitions keep their legacy bare names, others get `rel_<id>` expressions) — anything already customized by the user, a saved view, or a shared URL is left alone, and the URL hash serializes columns only when they differ from `defaultSelectColumns`. The name column is force-kept (`ensureNameColumn`) — removing it breaks identity, scroll, and role edits. Extra columns come from account properties, lazy/virtual-table joins under `system.accounts`, data-warehouse joins, freeform SQL, or **custom properties** — all assembled by `buildAccountColumnGroups`.
+Default columns: `name`, `tag_names`, `notebook_count`, plus one relationship column per team definition. `ACCOUNTS_HOGQL_DEFAULT_SELECT` (base columns only) is just the pre-load seed; once `loadRelationshipDefinitionsSuccess` fires, still-default columns are upgraded to the `defaultSelectColumns` selector (seeded definitions keep their legacy bare names, others get `rel_<id>` expressions) — anything already customized by the user, a saved view, or a shared URL is left alone, and the URL hash serializes columns only when they differ from `defaultSelectColumns`. The name column is force-kept (`ensureNameColumn`) — removing it breaks identity, scroll, and role edits. Extra columns come from account properties, lazy/virtual-table joins under `system.accounts`, data-warehouse joins, freeform SQL, or **custom properties** — all assembled by `buildAccountColumnGroups`. `CUSTOMER_ANALYTICS_ACCOUNTS_HOGQL_CLEANUP` removes freeform SQL, data-warehouse joins, and arbitrary lazy/virtual-table groups from the picker while retaining the Postgres-backed tags and notebooks joins. It also removes raw-expression editing for non-custom-property columns. Existing saved views keep their stored expressions so the experiment measures existing usage without breaking those views.
**Custom property columns** surface the team's `CustomPropertyDefinition`s (loaded in `accountsColumnConfigLogic` via the generated `customPropertyDefinitionsList`) as a "Custom properties" picker group. Each is selected as ``accounts.custom_properties.values.`<definition-id>` AS cp_<id>`` — a JSON dot-access through the `custom_properties` lazy join on `system.accounts` (backed by the `customer_analytics_custompropertyvalue` EAV table; one JOIN regardless of column count). Because the alias is an opaque `cp_<id>`, every label-bearing surface must resolve it back via the `aliasToDefinition` selector: the table header (`useContextColumns` in `AccountsHogQLTable`) and the configurator's "Visible columns" list (`SelectedAccountColumn`). Cells render by display type (`CustomPropertyCell`: date→`TZLabel`, boolean→icon, select→`LemonColorGlyph` + label, numeric→`formatCustomPropertyValue`). Sorting a numeric custom property (display type `number`/`currency`/`percent`) casts the (string) JSON value with `toFloatOrNull(...)` in the `orderBy` — see `orderByExpression` in `accountsLogic`, driven by `aliasToDefinition` — so numbers sort by magnitude rather than lexically; non-numeric types sort by the alias directly. The stored sort state (URL hash, saved views) keeps the clean column name; the cast is applied only at query-build time. Numeric custom properties are also selectable in the **overview tiles** sum/avg/min/max/median/threshold pickers — `numericColumnOptions` recognizes the display type and wraps the value in `toFloatOrNull(...)` the same way so aggregation is numeric.
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx
index 7a84b45ff6b1..976b6c625517 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx
@@ -182,10 +182,14 @@ function ColumnEditSection({
column: string
columnIndex: number
onClose: () => void
-}): JSX.Element {
- const { aliasToDefinition } = useValues(accountsColumnConfigLogic)
+}): JSX.Element | null {
+ const { aliasToDefinition, hogqlCleanupEnabled } = useValues(accountsColumnConfigLogic)
const definition = aliasToDefinition[extractDisplayLabel(column)]
+ if (!definition && hogqlCleanupEnabled) {
+ return null
+ }
+
return (
<div className="w-full flex flex-col gap-2 p-3 border border-border rounded" data-attr="accounts-column-edit">
<div className="flex items-center justify-between">
@@ -314,7 +318,8 @@ function SelectedAccountColumn({
onEdit: (index: number) => void
onRemove: (column: string) => void
}): JSX.Element {
- const { aliasToDefinition, aliasToRelationshipDefinition } = useValues(accountsColumnConfigLogic)
+ const { aliasToDefinition, aliasToRelationshipDefinition, hogqlCleanupEnabled } =
+ useValues(accountsColumnConfigLogic)
const { setNodeRef, attributes, transform, transition, listeners } = useSortable({ id: column })
const alias = extractDisplayLabel(column)
// Custom-property and relationship columns are aliased to opaque `cp_<id>` / `rel_<id>`
@@ -323,6 +328,7 @@ function SelectedAccountColumn({
// `name` carries the row identity (account id) and external_id for the
// Account cell — removing it would break row expansion and role updates.
const isMandatory = column === ACCOUNTS_NAME_COLUMN
+ const canEdit = !isMandatory && (!!aliasToDefinition[alias] || !hogqlCleanupEnabled)
return (
<div
@@ -339,13 +345,13 @@ function SelectedAccountColumn({
{label}
</span>
<div className="flex-1" />
- {isMandatory ? null : (
+ {canEdit ? (
<Tooltip title="Edit">
<LemonButton onClick={() => onEdit(dataIndex)} size="small" active={isEditing}>
<IconPencil data-attr="column-display-item-edit-icon" />
</LemonButton>
</Tooltip>
- )}
+ ) : null}
<Tooltip title={isMandatory ? 'This column is required' : 'Remove'}>
<LemonButton
onClick={() => onRemove(column)}
diff --git a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts
index f456498c173c..76cc38556cb2 100644
--- a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts
+++ b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts
@@ -1,4 +1,6 @@
import { extractDisplayLabel } from '~/queries/nodes/DataTable/utils'
+import type { DatabaseSchemaTable } from '~/queries/schema/schema-general'
+import type { DataWarehouseViewLink } from '~/types'
import type {
AccountRelationshipDefinitionApi,
@@ -112,6 +114,67 @@ describe('accountsColumnConfigLogic column groups and translation', () => {
expect(buildAccountColumnGroups({}, [], [], []).map((group) => group.key)).not.toContain('relationships')
})
+ it('limits the picker to Postgres-backed groups when HogQL cleanup is enabled', () => {
+ const table = (name: string, fields: Record<string, Record<string, unknown>>): DatabaseSchemaTable =>
+ ({ name, fields }) as unknown as DatabaseSchemaTable
+ const allTablesMap = {
+ 'system.accounts': table('accounts', {
+ name: { name: 'name', type: 'string', hogql_value: 'name' },
+ tags: { name: 'tags', type: 'lazy_table', table: 'account_tags', fields: ['names'] },
+ notebooks: {
+ name: 'notebooks',
+ type: 'lazy_table',
+ table: 'account_notebooks',
+ fields: ['count'],
+ },
+ enrichment: {
+ name: 'enrichment',
+ type: 'virtual_table',
+ table: 'account_enrichment',
+ fields: ['score'],
+ },
+ }),
+ account_tags: table('account_tags', { names: { name: 'names', type: 'array' } }),
+ account_notebooks: table('account_notebooks', { count: { name: 'count', type: 'integer' } }),
+ account_enrichment: table('account_enrichment', { score: { name: 'score', type: 'float' } }),
+ 'warehouse.accounts': table('warehouse.accounts', { tier: { name: 'tier', type: 'string' } }),
+ }
+ const warehouseJoins = [
+ {
+ source_table_name: 'system.accounts',
+ field_name: 'warehouse_account',
+ joining_table_name: 'warehouse.accounts',
+ } as DataWarehouseViewLink,
+ ]
+ const customDefinition = definition('11111111-2222-3333-4444-555555555555', 'Plan')
+ const relationship = relationshipDefinition('66666666-7777-8888-9999-000000000000', 'CSM')
+
+ const unrestrictedKeys = buildAccountColumnGroups(
+ allTablesMap,
+ warehouseJoins,
+ [customDefinition],
+ [relationship]
+ ).map((group) => group.key)
+ const restrictedKeys = buildAccountColumnGroups(
+ allTablesMap,
+ warehouseJoins,
+ [customDefinition],
+ [relationship],
+ true
+ ).map((group) => group.key)
+
+ expect(unrestrictedKeys).toEqual(
+ expect.arrayContaining(['accounts.enrichment', 'accounts.warehouse_account', 'sql_expression'])
+ )
+ expect(restrictedKeys).toEqual([
+ 'account_properties',
+ 'relationships',
+ 'custom_properties',
+ 'accounts.tags',
+ 'accounts.notebooks',
+ ])
+ })
+
it('translateSelectColumns resolves legacy roles through the lazy join and drops unmatched ones', () => {
const csm = relationshipDefinition('11111111-2222-3333-4444-555555555555', 'CSM')
const map = roleKeyToDefinitionMap([
diff --git a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts
index d846025c4776..5d72b8c4d951 100644
--- a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts
+++ b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts
@@ -2,6 +2,8 @@ import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, redu
import { loaders } from 'kea-loaders'
import type { SimpleOption } from 'lib/components/TaxonomicFilter/types'
+import { FEATURE_FLAGS } from 'lib/constants'
+import { featureFlagLogic, type FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { objectsEqual } from 'lib/utils/objects'
import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic'
import { projectLogic } from 'scenes/projectLogic'
@@ -219,6 +221,7 @@ const JOIN_FIELD_TYPES = new Set(['lazy_table', 'virtual_table', 'view', 'materi
// Joins that already have a friendly, definition-driven picker group — surfacing
// their raw backing tables (account_id + a JSON blob) would just duplicate them.
const HIDDEN_JOIN_GROUPS = new Set(['custom_properties', 'relationships'])
+const POSTGRES_BACKED_JOIN_GROUPS = new Set(['tags', 'notebooks'])
// Field types we omit from the "Account properties" group — these are
// navigation aliases, joined tables (handled separately), or unknown types.
@@ -278,7 +281,8 @@ export function buildAccountColumnGroups(
allTablesMap: Record<string, DatabaseSchemaTable> | null | undefined,
warehouseJoins: DataWarehouseViewLink[],
customPropertyDefinitions: CustomPropertyDefinitionApi[] = [],
- relationshipDefinitions: AccountRelationshipDefinitionApi[] = []
+ relationshipDefinitions: AccountRelationshipDefinitionApi[] = [],
+ postgresColumnsOnly = false
): AccountColumnGroup[] {
const accountsTable = allTablesMap?.[ACCOUNTS_ACCOUNTS_TABLE_NAME]
const directOptions: AccountColumnOption[] = []
@@ -299,7 +303,10 @@ export function buildAccountColumnGroups(
if (accountsTable) {
for (const field of Object.values(accountsTable.fields)) {
if (JOIN_FIELD_TYPES.has(field.type)) {
- if (HIDDEN_JOIN_GROUPS.has(field.name)) {
+ if (
+ HIDDEN_JOIN_GROUPS.has(field.name) ||
+ (postgresColumnsOnly && !POSTGRES_BACKED_JOIN_GROUPS.has(field.name))
+ ) {
continue
}
const joinedTable = field.table ? allTablesMap?.[field.table] : undefined
@@ -321,21 +328,23 @@ export function buildAccountColumnGroups(
// separate `joins` array on the schema response (loaded by `joinsLogic`),
// not inside the source table's `fields`. Surface them as additional
// first-class column groups so users don't have to drop to SQL.
- for (const join of warehouseJoins) {
- if (
- !join.source_table_name ||
- !ACCOUNTS_JOIN_SOURCE_TABLE_NAMES.has(join.source_table_name) ||
- !join.field_name ||
- !join.joining_table_name
- ) {
- continue
- }
- const joinedTable = allTablesMap?.[join.joining_table_name]
- if (!joinedTable) {
- continue
+ if (!postgresColumnsOnly) {
+ for (const join of warehouseJoins) {
+ if (
+ !join.source_table_name ||
+ !ACCOUNTS_JOIN_SOURCE_TABLE_NAMES.has(join.source_table_name) ||
+ !join.field_name ||
+ !join.joining_table_name
+ ) {
+ continue
+ }
+ const joinedTable = allTablesMap?.[join.joining_table_name]
+ if (!joinedTable) {
+ continue
+ }
+ const columnNames = Object.keys(joinedTable.fields)
+ addJoinGroup(join.field_name, buildJoinOptions(join.field_name, columnNames, joinedTable))
}
- const columnNames = Object.keys(joinedTable.fields)
- addJoinGroup(join.field_name, buildJoinOptions(join.field_name, columnNames, joinedTable))
}
// Omit definition-driven groups entirely when the team has no definitions, so the
@@ -366,7 +375,9 @@ export function buildAccountColumnGroups(
...relationshipGroups,
...customPropertyGroups,
...joinGroups,
- { key: 'sql_expression', label: 'SQL expression', options: [], isFreeform: true },
+ ...(postgresColumnsOnly
+ ? []
+ : [{ key: 'sql_expression' as const, label: 'SQL expression', options: [], isFreeform: true }]),
]
}
@@ -374,6 +385,7 @@ export function buildAccountColumnGroups(
export interface accountsColumnConfigLogicValues {
allTablesMap: Record<string, DatabaseSchemaTable> // databaseTableListLogic
databaseLoading: boolean // databaseTableListLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
warehouseJoins: DataWarehouseViewLink[] // joinsLogic
warehouseJoinsLoading: boolean // joinsLogic
currentProjectId: number | null // projectLogic
@@ -398,6 +410,7 @@ export interface accountsColumnConfigLogicValues {
editingColumn: string | null
editingColumnIndex: number | null
filteredColumnOptions: AccountPickerColumnOption[]
+ hogqlCleanupEnabled: boolean
pickerGroupKey: PickerGroupKey
pickerSearch: string
pickerSearchPlaceholder: string
@@ -527,11 +540,13 @@ export interface accountsColumnConfigLogicMeta {
columnDisplay: AccountColumnDisplayState
) => string[]
visibleColumnNames: (querySelectColumns: string[]) => string[]
+ hogqlCleanupEnabled: (featureFlags: FeatureFlagsSet) => boolean
accountsColumnGroups: (
allTablesMap: Record<string, DatabaseSchemaTable>,
warehouseJoins: DataWarehouseViewLink[],
customPropertyDefinitions: CustomPropertyDefinitionApi[],
- relationshipDefinitions: AccountRelationshipDefinitionApi[]
+ relationshipDefinitions: AccountRelationshipDefinitionApi[],
+ hogqlCleanupEnabled: boolean
) => AccountColumnGroup[]
activePickerGroup: (
accountsColumnGroups: AccountColumnGroup[],
@@ -582,6 +597,8 @@ export const accountsColumnConfigLogic = kea<accountsColumnConfigLogicType>([
['currentTeamId'],
projectLogic,
['currentProjectId'],
+ featureFlagLogic,
+ ['featureFlags'],
databaseTableListLogic,
['allTablesMap', 'databaseLoading'],
joinsLogic,
@@ -761,19 +778,32 @@ export const accountsColumnConfigLogic = kea<accountsColumnConfigLogicType>([
(s) => [s.querySelectColumns],
(querySelectColumns: string[]): string[] => querySelectColumns.map((c) => extractDisplayLabel(c)),
],
+ hogqlCleanupEnabled: [
+ (s) => [s.featureFlags],
+ (featureFlags: FeatureFlagsSet): boolean =>
+ !!featureFlags[FEATURE_FLAGS.CUSTOMER_ANALYTICS_ACCOUNTS_HOGQL_CLEANUP],
+ ],
accountsColumnGroups: [
- (s) => [s.allTablesMap, s.warehouseJoins, s.customPropertyDefinitions, s.relationshipDefinitions],
+ (s) => [
+ s.allTablesMap,
+ s.warehouseJoins,
+ s.customPropertyDefinitions,
+ s.relationshipDefinitions,
+ s.hogqlCleanupEnabled,
+ ],
(
allTablesMap: Record<string, DatabaseSchemaTable>,
warehouseJoins: DataWarehouseViewLink[],
customPropertyDefinitions: CustomPropertyDefinitionApi[],
- relationshipDefinitions: AccountRelationshipDefinitionApi[]
+ relationshipDefinitions: AccountRelationshipDefinitionApi[],
+ hogqlCleanupEnabled: boolean
): AccountColumnGroup[] =>
buildAccountColumnGroups(
allTablesMap,
warehouseJoins,
customPropertyDefinitions,
- relationshipDefinitions
+ relationshipDefinitions,
+ hogqlCleanupEnabled
),
],
activePickerGroup: [
diff --git a/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.ts b/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.ts
index aae4054cc23e..94c5b621a294 100644
--- a/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.ts
+++ b/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.ts
@@ -3,6 +3,8 @@ import { MOCK_DEFAULT_TEAM } from '~/lib/api.mock'
import { router } from 'kea-router'
import { expectLogic } from 'kea-test-utils'
+import { FEATURE_FLAGS } from 'lib/constants'
+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -131,6 +133,16 @@ describe('accountsLogic', () => {
expect(logic.values.assignedToFilter).toEqual([])
})
+ it('removes HogQL-only column groups when the cleanup flag is enabled', () => {
+ featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.CUSTOMER_ANALYTICS_ACCOUNTS_HOGQL_CLEANUP], {
+ [FEATURE_FLAGS.CUSTOMER_ANALYTICS_ACCOUNTS_HOGQL_CLEANUP]: true,
+ })
+
+ const config = accountsColumnConfigLogic.findMounted()!
+ expect(config.values.hogqlCleanupEnabled).toBe(true)
+ expect(config.values.accountsColumnGroups.map((group) => group.key)).not.toContain('sql_expression')
+ })
+
it('setTagsFilter updates the reducer', () => {
logic.actions.setTagsFilter(['enterprise'])
expect(logic.values.tagsFilter).toEqual(['enterprise'])