-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/runTableFiltersForEvaluation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {RunsFilter} from '../../graphql/types'; | ||
|
||
const BACKFILL_ID_LENGTH = 8; | ||
|
||
/** | ||
* For a single asset for a single tick, DA will either request a list of runs or a single backfill. | ||
* When DA requests a backfill we want to show a row for that backfill in the table, so we need to | ||
* construct the RunsFilter differently. Backfill IDs are 8 characters long, so we can use that to | ||
* determine if a backfill was requested. If DA is updated to request multiple backfills in a | ||
* single evaluation, or emit a combination of runs and backfills in a single evaluation, this | ||
* logic will need to be updated. | ||
*/ | ||
export const runTableFiltersForEvaluation = (runIds: string[]): RunsFilter | null => { | ||
const firstRunId = runIds[0]; | ||
if (firstRunId) { | ||
if (firstRunId.length === BACKFILL_ID_LENGTH) { | ||
return {tags: [{key: 'dagster/backfill', value: firstRunId}]}; | ||
} | ||
return {runIds}; | ||
} | ||
return null; | ||
}; |