Skip to content

Commit

Permalink
[dagit] Explicitly add the dagster/step_selection tag to asset runs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Mar 31, 2022
1 parent 4588b22 commit b9284ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
LaunchPartitionBackfill,
LaunchPartitionBackfillVariables,
} from '../../partitions/types/LaunchPartitionBackfill';
import {DagsterTag} from '../../runs/RunTag';
import {handleLaunchResult, LAUNCH_PIPELINE_EXECUTION_MUTATION} from '../../runs/RunUtils';
import {
LaunchPipelineExecution,
Expand Down Expand Up @@ -200,6 +201,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({

const tags = [...partition.tagsOrError.results];
const runConfigData = yaml.parse(partition.runConfigOrError.yaml || '') || {};
const stepKeys = assets.map((a) => a.opName!);

const launchResult = await client.mutate<
LaunchPipelineExecution,
Expand All @@ -210,14 +212,17 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({
executionParams: {
runConfigData,
mode: partition.mode,
stepKeys: assets.map((a) => a.opName!),
stepKeys: stepKeys,
selector: {
repositoryLocationName: repoAddress.location,
repositoryName: repoAddress.name,
jobName: assetJobName,
},
executionMetadata: {
tags: tags.map((t) => pick(t, ['key', 'value'])),
tags: [
...tags.map((t) => pick(t, ['key', 'value'])),
{key: DagsterTag.StepSelection, value: stepKeys.join(',')},
],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';

import {AssetKey} from '../../assets/types';
import {LaunchRootExecutionButton} from '../../launchpad/LaunchRootExecutionButton';
import {DagsterTag} from '../../runs/RunTag';
import {buildRepoAddress} from '../buildRepoAddress';

import {LaunchAssetChoosePartitionsDialog} from './LaunchAssetChoosePartitionsDialog';
Expand Down Expand Up @@ -97,7 +98,14 @@ export const LaunchAssetExecutionButton: React.FC<{
getVariables={() => ({
executionParams: {
mode: 'default',
executionMetadata: {},
executionMetadata: {
tags: [
{
key: DagsterTag.StepSelection,
value: assets.map((o) => o.opName!).join(','),
},
],
},
runConfigData: {},
stepKeys: assets.map((o) => o.opName!),
selector: {
Expand Down

0 comments on commit b9284ce

Please sign in to comment.