Skip to content

Commit

Permalink
Fix Run Timeline splitting out ad hoc jobs (#22520)
Browse files Browse the repository at this point in the history
## Summary & Motivation


https://dagsterlabs.slack.com/archives/C070G3UNNLW/p1718238323769339?thread_ts=1718238288.884269&cid=C070G3UNNLW


before: multiple rows for adhoc materializations
<img width="1332" alt="Screenshot 2024-06-12 at 8 36 48 PM"
src="https://github.com/dagster-io/dagster/assets/2286579/b0310a78-465c-42ab-9231-e83cad77ee55">


after: just a single one:
<img width="1579" alt="Screenshot 2024-06-12 at 8 37 01 PM"
src="https://github.com/dagster-io/dagster/assets/2286579/51f4dd24-9005-4958-bdf2-57f633731e29">
  • Loading branch information
salazarm committed Jun 13, 2024
1 parent 64f1e23 commit b94dd41
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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] || {});
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b94dd41

Please sign in to comment.