diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsForTimeline.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsForTimeline.tsx index ccdf487d0e3ad..755b01b1530d0 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsForTimeline.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsForTimeline.tsx @@ -406,6 +406,7 @@ export const useRunsForTimeline = ({ if (!workspaceOrError || workspaceOrError.__typename === 'PythonError' || _end < Date.now()) { return jobsWithCompletedRunsAndOngoingRunsValues; } + const addedAdHocJobs = new Set(); const jobs: TimelineJob[] = []; for (const locationEntry of workspaceOrError.locationEntries) { if ( @@ -450,6 +451,13 @@ export const useRunsForTimeline = ({ const isAdHoc = isHiddenAssetGroupJob(pipeline.name); const jobKey = makeJobKey(repoAddress, pipeline.name); + if (isAdHoc) { + if (addedAdHocJobs.has(jobKey)) { + continue; + } + addedAdHocJobs.add(jobKey); + } + const jobName = isAdHoc ? 'Ad hoc materializations' : pipeline.name; const jobRuns = Object.values(runsByJobKey[jobKey] || {}); @@ -553,7 +561,9 @@ export const useRunsForTimeline = ({ }; export const makeJobKey = (repoAddress: RepoAddress, jobName: string) => - `${jobName}-${repoAddressAsHumanString(repoAddress)}`; + `${isHiddenAssetGroupJob(jobName) ? '__adhoc__' : jobName}-${repoAddressAsHumanString( + repoAddress, + )}`; const RUN_TIMELINE_FRAGMENT = gql` fragment RunTimelineFragment on Run {