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.

fix(data-modeling): remove disabled multi-dag ui (#92332)

Jovan Sakoviccf95bf3ff0cc
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 810bf61cd2f7..2e6874678afe 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -304,7 +304,6 @@ export const FEATURE_FLAGS = {
DASHBOARD_WIDGETS: 'dashboard-widgets', // owner: @mattp #team-analytics-platform
DATA_MODELING_BACKEND_V2: 'data-modeling-backend-v2', // owner: #team-data-modeling
DATA_MODELING_INCREMENTAL_VIEWS: 'data-modeling-incremental-views', // owner: #team-data-modeling
- DATA_MODELING_MULTI_DAG: 'data-modeling-multi-dag', // owner: #team-data-modeling
DATA_MODELING_SUSPEND_FAILING_NODES: 'data-modeling-suspend-failing-nodes', // owner: #team-data-modeling
DATA_MODELING_TAB: 'data-modeling-tab', // owner: #team-data-modeling
DATA_QUALITY_CHECKS: 'data-quality-checks', // owner: #team-data-modeling
diff --git a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.test.ts b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.test.ts
index a1c017750cfe..1962cd283a0a 100644
--- a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.test.ts
+++ b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.test.ts
@@ -2920,7 +2920,6 @@ describe('sqlEditorLogic', () => {
true,
undefined,
undefined,
- undefined,
false,
undefined,
incremental
diff --git a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
index 257b1f21242f..936013c617de 100644
--- a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
@@ -95,7 +95,6 @@ import {
dataCatalogMetricsPartialUpdate,
dataCatalogMetricsRetrieve,
} from 'products/data_catalog/frontend/generated/api'
-import { DagSelector, openCreateDagDialog } from 'products/data_modeling/frontend/DagSelector'
import { sourcesDataLogic } from 'products/data_warehouse/frontend/shared/logics/sourcesDataLogic'
import { validateEndpointName } from 'products/endpoints/frontend/common'
@@ -106,7 +105,7 @@ import type { PaginatedResponse } from '../../../lib/api'
export const MANAGED_WAREHOUSE_SOURCE_PREFIX = 'managed_warehouse'
import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
import type { DatabaseSchemaQueryResponse, Node } from '../../../queries/schema/schema-general'
-import type { DataModelingDAG, DataWarehouseSavedQueryFolder, UserType } from '../../../types'
+import type { DataWarehouseSavedQueryFolder, UserType } from '../../../types'
import { dataWarehouseViewsLogic } from '../saved_queries/dataWarehouseViewsLogic'
import { validateSavedQueryName } from '../saved_queries/savedQueryNameValidation'
import { dataModelingLogic } from '../scene/dataModelingLogic'
@@ -536,8 +535,6 @@ const LazyQuery = lazyWithRetry(() =>
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface sqlEditorLogicValues {
connectionOptions: ExternalDataSourceConnectionOptionApi[] | null // connectionSelectorLogic
- dags: DataModelingDAG[] // dataModelingLogic
- selectedDagId: string | null // dataModelingLogic
dataWarehouseSavedQueries: DataWarehouseSavedQuery[] // dataWarehouseViewsLogic
dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[] // dataWarehouseViewsLogic
dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery> // dataWarehouseViewsLogic
@@ -982,13 +979,11 @@ export interface sqlEditorLogicActions {
name: string,
materializeAfterSave?: any,
fromDraft?: string,
- dagId?: string,
folderId?: string | null,
isTest?: any,
queryOverride?: string,
incremental?: DataWarehouseSavedQueryIncremental
) => {
- dagId: string | undefined
folderId: string | null | undefined
fromDraft: string | undefined
incremental: DataWarehouseSavedQueryIncremental | undefined
@@ -1254,8 +1249,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
['database', 'databaseLoading', 'connectionId as databaseConnectionId'],
outputPaneLogic({ tabId: props.tabId }),
['activeTab as outputActiveTab'],
- dataModelingLogic,
- ['dags', 'selectedDagId'],
],
actions: [
dataWarehouseViewsLogic,
@@ -1325,7 +1318,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
fromDraft?: string,
- dagId?: string,
folderId?: string | null,
isTest = false,
queryOverride?: string,
@@ -1334,7 +1326,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
name,
materializeAfterSave,
fromDraft,
- dagId,
folderId,
isTest,
queryOverride,
@@ -2164,13 +2155,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
tryShowMCPHint('sql.execute', truncated ? { derivedPrompt: `Run this SQL: ${truncated}` } : undefined)
},
saveAsView: async ({ fromDraft, materializeAfterSave = false }) => {
- const multiDagEnabled = !!values.featureFlags[FEATURE_FLAGS.DATA_MODELING_MULTI_DAG]
-
- // Ensure DAGs are loaded via dataModelingLogic
- if (multiDagEnabled && values.dags.length === 0) {
- await dataModelingLogic.asyncActions.loadDags()
- }
-
const isStaff = values.user?.is_staff ?? false
const candidates = resolveSaveCandidates()
const selectedRef = {
@@ -2236,9 +2220,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
incrementalKey: incrementalCheck?.key_candidates[0] ?? null,
incrementalUniqueKey: [],
incrementalLookbackSeconds: 0,
- dagId: multiDagEnabled
- ? (values.dags.find((d) => d.id === values.selectedDagId)?.id ?? values.dags[0]?.id ?? null)
- : undefined,
},
description: `View names must start with a letter, '_', or '$' and can only contain letters, numbers, '_', '.', or '$'. Spaces are not allowed.`,
content: (isLoading) =>
@@ -2285,40 +2266,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
/>
)}
</LemonField>
- {multiDagEnabled && (
- <LemonField name="dagId" label="Add to DAG" className="flex-1">
- {({ value: dagId, onChange: setDagId }) => (
- <DagSelector
- selectedDagId={dagId}
- onSelectDag={setDagId}
- onCreateDag={(onSelect) => {
- openCreateDagDialog({
- existingNames: new Set(
- dataModelingLogic.values.dags.map((d) => d.name)
- ),
- onSubmit: async (dagData) => {
- try {
- const newDag =
- await api.dataModelingDags.create(dagData)
- await dataModelingLogic.asyncActions.loadDags()
- onSelect(newDag.id)
- lemonToast.success('DAG created')
- } catch (error) {
- lemonToast.error(
- error instanceof ApiError
- ? (error.detail ?? 'Failed to create DAG')
- : 'Failed to create DAG'
- )
- // Re-throw so the dialog stays open for the user to retry.
- throw error
- }
- },
- })
- }}
- />
- )}
- </LemonField>
- )}
</div>
{isStaff && (
<LemonField name="isTest" className="mt-2">
@@ -2365,7 +2312,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
),
errors: {
viewName: validateSavedQueryName,
- dagId: (dagId) => (multiDagEnabled && !dagId ? 'Please select a DAG' : undefined),
incrementalKey: (key, { incrementalEnabled, materializeAfterSave: materialize }) =>
incrementalEnabled && materialize && !key ? 'Select the incremental column' : undefined,
incrementalUniqueKey: (uniqueKey, { incrementalEnabled, materializeAfterSave: materialize }) =>
@@ -2375,7 +2321,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
},
onSubmit: async ({
viewName,
- dagId,
folderId,
isTest,
materializeAfterSave: shouldMaterialize,
@@ -2397,15 +2342,11 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
viewName,
shouldMaterialize ?? false,
fromDraft,
- dagId,
folderId,
isTest ?? false,
selectedRef.current,
incremental
)
- if (multiDagEnabled && dagId) {
- dataModelingLogic.actions.setSelectedDagId(dagId)
- }
},
shouldAwaitSubmit: true,
})
@@ -2414,7 +2355,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
name,
materializeAfterSave = false,
fromDraft,
- dagId,
folderId,
isTest = false,
queryOverride,
@@ -2453,7 +2393,6 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
query: queryToSave,
types,
...(folderId ? { folder_id: folderId } : {}),
- ...(dagId ? { dag_id: dagId } : {}),
...(isTest ? { is_test: true } : {}),
...(incremental ? { incremental } : {}),
})
diff --git a/frontend/src/scenes/data-warehouse/scene/DataModelingTab.tsx b/frontend/src/scenes/data-warehouse/scene/DataModelingTab.tsx
index 92fbe74eea3e..fd977a639e17 100644
--- a/frontend/src/scenes/data-warehouse/scene/DataModelingTab.tsx
+++ b/frontend/src/scenes/data-warehouse/scene/DataModelingTab.tsx
@@ -1,28 +1,15 @@
import { useActions, useValues } from 'kea'
import { IconDirectedGraph, IconList } from '@posthog/icons'
-import { LemonInput, LemonSegmentedButton, LemonSelect, Spinner } from '@posthog/lemon-ui'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { LemonInput, LemonSegmentedButton, Spinner } from '@posthog/lemon-ui'
import { dataModelingLogic } from './dataModelingLogic'
import { GraphView } from './modeling/GraphView'
import { TableView } from './modeling/TableView'
function ToolBar(): JSX.Element {
- const { viewNodes, searchTerm, viewMode, dags, selectedDagId } = useValues(dataModelingLogic)
- const { setSearchTerm, setViewMode, setSelectedDagId } = useActions(dataModelingLogic)
- const { featureFlags } = useValues(featureFlagLogic)
- const multiDagEnabled = !!featureFlags[FEATURE_FLAGS.DATA_MODELING_MULTI_DAG]
-
- const dagOptions =
- viewMode === 'graph'
- ? dags.map((d) => ({ value: d.id, label: d.name }))
- : [
- { value: null as string | null, label: 'All DAGs' },
- ...dags.map((d) => ({ value: d.id, label: d.name })),
- ]
+ const { viewNodes, searchTerm, viewMode } = useValues(dataModelingLogic)
+ const { setSearchTerm, setViewMode } = useActions(dataModelingLogic)
return (
<div className="flex gap-2 items-center">
@@ -30,18 +17,6 @@ function ToolBar(): JSX.Element {
<LemonInput type="search" placeholder="Search models..." onChange={setSearchTerm} value={searchTerm} />
)}
<div className="flex gap-2 ml-auto items-center">
- {multiDagEnabled && dags.length > 0 && (
- <LemonSelect
- value={selectedDagId}
- onChange={setSelectedDagId}
- options={dagOptions}
- className="w-44"
- truncateText={{ maxWidthClass: 'max-w-28' }}
- dropdownMatchSelectWidth={false}
- menu={{ className: 'max-w-60' }}
- size="small"
- />
- )}
<LemonSegmentedButton
value={viewMode}
onChange={(value) => setViewMode(value)}
diff --git a/products/data_modeling/frontend/DagSelector.tsx b/products/data_modeling/frontend/DagSelector.tsx
deleted file mode 100644
index 6f4a054430cf..000000000000
--- a/products/data_modeling/frontend/DagSelector.tsx
+++ /dev/null
@@ -1,110 +0,0 @@
-import { useValues } from 'kea'
-
-import { LemonDialog, LemonInput, LemonSelect } from '@posthog/lemon-ui'
-
-import { LemonField } from 'lib/lemon-ui/LemonField'
-import { dataModelingLogic } from 'scenes/data-warehouse/scene/dataModelingLogic'
-
-import { DataModelingSyncInterval } from '~/types'
-
-const CREATE_NEW_DAG_VALUE = '__create_new__'
-
-const SYNC_FREQUENCY_OPTIONS: { value: DataModelingSyncInterval; label: string }[] = [
- { value: '15min', label: '15 minutes' },
- { value: '30min', label: '30 minutes' },
- { value: '1hour', label: '1 hour' },
- { value: '6hour', label: '6 hours' },
- { value: '12hour', label: '12 hours' },
- { value: '24hour', label: 'Daily' },
- { value: '7day', label: 'Weekly' },
- { value: '30day', label: 'Monthly' },
-]
-
-export function openCreateDagDialog({
- existingNames,
- onSubmit,
-}: {
- existingNames: Set<string>
- onSubmit: (dag: {
- name: string
- description: string
- sync_frequency: DataModelingSyncInterval
- }) => void | Promise<void>
-}): void {
- LemonDialog.openForm({
- title: 'New DAG',
- shouldAwaitSubmit: true,
- initialValues: {
- dagName: '',
- dagDescription: '',
- syncFrequency: '24hour' as DataModelingSyncInterval,
- },
- content: (
- <>
- <LemonField name="dagName" label="Name">
- <LemonInput placeholder="Enter a DAG name" autoFocus />
- </LemonField>
- <LemonField name="dagDescription" label="Description" className="mt-2">
- <LemonInput placeholder="Optional description" />
- </LemonField>
- <LemonField name="syncFrequency" label="Sync frequency" className="mt-2">
- {({ value, onChange }) => (
- <LemonSelect value={value} onChange={onChange} options={SYNC_FREQUENCY_OPTIONS} fullWidth />
- )}
- </LemonField>
- </>
- ),
- errors: {
- dagName: (name) => {
- if (!name?.trim()) {
- return 'You must enter a DAG name'
- }
- if (existingNames.has(name.trim())) {
- return 'A DAG with this name already exists'
- }
- return undefined
- },
- },
- onSubmit: ({ dagName, dagDescription, syncFrequency }) => {
- return onSubmit({
- name: dagName.trim(),
- description: dagDescription?.trim() ?? '',
- sync_frequency: syncFrequency,
- })
- },
- })
-}
-
-export function DagSelector({
- selectedDagId,
- onSelectDag,
- onCreateDag,
-}: {
- selectedDagId: string | null
- onSelectDag: (dagId: string | null) => void
- onCreateDag: (onSelect: (newDagId: string) => void) => void
-}): JSX.Element {
- const { dags } = useValues(dataModelingLogic)
- const options = [
- ...dags.map((d) => ({ value: d.id, label: d.name })),
- { value: CREATE_NEW_DAG_VALUE, label: '+ Create new DAG' },
- ]
-
- const handleSelectChange = (selected: string | null): void => {
- if (selected === CREATE_NEW_DAG_VALUE) {
- onCreateDag(onSelectDag)
- } else {
- onSelectDag(selected)
- }
- }
-
- return (
- <LemonSelect
- value={selectedDagId}
- onChange={handleSelectChange}
- options={options}
- placeholder="Select a DAG"
- fullWidth
- />
- )
-}
diff --git a/products/logs/frontend/components/LogsSqlEditor/logsSqlEditorTrackingLogic.ts b/products/logs/frontend/components/LogsSqlEditor/logsSqlEditorTrackingLogic.ts
index 74b1617b2b79..96fc4a237b10 100644
--- a/products/logs/frontend/components/LogsSqlEditor/logsSqlEditorTrackingLogic.ts
+++ b/products/logs/frontend/components/LogsSqlEditor/logsSqlEditorTrackingLogic.ts
@@ -44,13 +44,11 @@ export interface logsSqlEditorTrackingLogicActions {
name: string,
materializeAfterSave?: any,
fromDraft?: string | undefined,
- dagId?: string | undefined,
folderId?: string | null | undefined,
isTest?: any,
queryOverride?: string | undefined,
incremental?: import('~/types').DataWarehouseSavedQueryIncremental | undefined
) => {
- dagId: string | undefined
folderId: string | null | undefined
fromDraft: string | undefined
incremental: import('~/types').DataWarehouseSavedQueryIncremental | undefined
diff --git a/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts b/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
index c1b4d18b7931..c9b6a105cea4 100644
--- a/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
+++ b/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
@@ -45,13 +45,11 @@ export interface metricsSqlEditorTrackingLogicActions {
name: string,
materializeAfterSave?: any,
fromDraft?: string | undefined,
- dagId?: string | undefined,
folderId?: string | null | undefined,
isTest?: any,
queryOverride?: string | undefined,
incremental?: import('~/types').DataWarehouseSavedQueryIncremental | undefined
) => {
- dagId: string | undefined
folderId: string | null | undefined
fromDraft: string | undefined
incremental: import('~/types').DataWarehouseSavedQueryIncremental | undefined