Skip to content

Commit

Permalink
[ui] Clean up Auto-materialize references (#23477)
Browse files Browse the repository at this point in the history
## Summary & Motivation

Remove some existing references to "Auto-materialize" and replace some
others with information about Declarative Automation.

## How I Tested These Changes

TS, lint.
  • Loading branch information
hellendag authored Aug 8, 2024
1 parent 94a088a commit 3d11bf1
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ const Header = ({assetNode, repoAddress}: HeaderProps) => {
</Box>
);
};

const AssetCatalogLink = styled(Link)`
display: flex;
gap: 4px;
Expand All @@ -264,13 +265,6 @@ const SIDEBAR_ASSET_FRAGMENT = gql`
cronSchedule
cronScheduleTimezone
}
autoMaterializePolicy {
rules {
className
decisionType
description
}
}
backfillPolicy {
description
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import {AssetEventsQuery} from '../../assets/types/useRecentAssetEvents.types';
import {ASSET_EVENTS_QUERY} from '../../assets/useRecentAssetEvents';
import {
AssetNode,
AutoMaterializeDecisionType,
RunStatus,
buildAssetNode,
buildAutoMaterializePolicy,
buildAutoMaterializeRule,
buildCompositeConfigType,
buildFreshnessPolicy,
buildRegularDagsterType,
Expand Down Expand Up @@ -278,18 +275,6 @@ export const AssetWithPolicies = () => {
buildEventsMock({reported: false}),
buildPartitionHealthMock(MockAssetKey.path[0]!),
buildSidebarQueryMock({
autoMaterializePolicy: buildAutoMaterializePolicy({
rules: [
buildAutoMaterializeRule({
decisionType: AutoMaterializeDecisionType.MATERIALIZE,
description: 'Rule 1',
}),
buildAutoMaterializeRule({
decisionType: AutoMaterializeDecisionType.SKIP,
description: 'Skip Rule 1',
}),
],
}),
freshnessPolicy: buildFreshnessPolicy({
maximumLagMinutes: 60,
cronSchedule: '* 1 1 1 1',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Body, Box, Colors, Icon, MiddleTruncate, Spinner} from '@dagster-io/ui-components';
import {Body, Box, Colors, MiddleTruncate, Spinner} from '@dagster-io/ui-components';
import {useEffect} from 'react';
import {Link} from 'react-router-dom';

Expand Down Expand Up @@ -69,20 +69,6 @@ export const AssetSidebarActivitySummary = ({
</SidebarSection>
)}

{asset.autoMaterializePolicy && (
<SidebarSection title="Auto-materialize policy">
<Box
padding={{horizontal: 24, vertical: 12}}
flex={{direction: 'row', gap: 4, alignItems: 'center'}}
>
<Link to={assetDetailsPathForKey(asset.assetKey, {view: 'automation'})}>
View automation history
</Link>
<Icon name="open_in_new" color={Colors.linkDefault()} />
</Box>
</SidebarSection>
)}

{asset.backfillPolicy && (
<SidebarSection title="Backfill policy">
<Box margin={{horizontal: 24, vertical: 12}} flex={{gap: 12, alignItems: 'flex-start'}}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Alert, Box, Colors, Icon, Tag, Tooltip} from '@dagster-io/ui-components';
import {Alert, Box, Colors, Icon} from '@dagster-io/ui-components';

import {useStateWithStorage} from '../../hooks/useStateWithStorage';

const LearnMoreLink =
const LEARN_MORE_LINK =
'https://docs.dagster.io/concepts/assets/asset-auto-execution#auto-materializing-assets-';

export const AutoMaterializeExperimentalBanner = () => {
Expand All @@ -14,15 +14,15 @@ export const AutoMaterializeExperimentalBanner = () => {
<Box padding={{horizontal: 24, vertical: 12}} border="bottom">
<Alert
intent="info"
title="Automation policies are experimental"
title="Automation conditions are experimental"
icon={<Icon name="info" color={Colors.accentBlue()} />}
onClose={() => {
setClosed(true);
}}
description={
<span>
You can learn more about this new feature and provide feedback{' '}
<a target="_blank" href={LearnMoreLink} rel="noreferrer">
<a target="_blank" href={LEARN_MORE_LINK} rel="noreferrer">
here
</a>
.
Expand All @@ -32,13 +32,3 @@ export const AutoMaterializeExperimentalBanner = () => {
</Box>
);
};

export const AutoMaterializeExperimentalTag = () => {
return (
<Tooltip content="Click to learn more about this new feature and provide feedback">
<a target="_blank" href={LearnMoreLink} rel="noreferrer">
<Tag intent="primary">Experimental</Tag>
</a>
</Tooltip>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export const AutomaterializeMiddlePanel = (props: Props) => {
Manage sensor
</AnchorButton>
</div>
<a href="https://docs.dagster.io/concepts/assets/asset-auto-execution">
Learn more about automation policies
<a href="https://docs.dagster.io/concepts/assets/declarative-automation">
Learn more about declarative automation
</a>
</Box>
</Body2>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {Alert} from '@dagster-io/ui-components';

export const DeclarativeAutomationBanner = () => {
return (
<Alert
intent="info"
title="[Experimental] Dagster can automatically materialize assets when criteria are met."
description={
<>
Automation conditions enable a declarative approach to asset automation. Instead of
defining imperative workflows to execute your assets, you just describe the conditions
under which they should be executed.{' '}
<a
href="https://docs.dagster.io/concepts/assets/declarative-automation"
target="_blank"
rel="noreferrer"
>
Learn more about declarative automation here
</a>
.
</>
}
/>
);
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {useLazyQuery} from '@apollo/client';
import {Alert, Box, Checkbox, Colors, Spinner, Subtitle2, Table} from '@dagster-io/ui-components';
import {Box, Checkbox, Colors, Spinner, Subtitle2, Table} from '@dagster-io/ui-components';
import {useCallback, useMemo, useState} from 'react';

import {ASSET_DAEMON_TICKS_QUERY} from './AssetDaemonTicksQuery';
import {AutomaterializationTickDetailDialog} from './AutomaterializationTickDetailDialog';
import {AutomaterializeRunHistoryTable} from './AutomaterializeRunHistoryTable';
import {DeclarativeAutomationBanner} from './DeclarativeAutomationBanner';
import {InstanceAutomaterializationEvaluationHistoryTable} from './InstanceAutomaterializationEvaluationHistoryTable';
import {
AssetDaemonTickFragment,
Expand Down Expand Up @@ -122,26 +123,8 @@ export const GlobalAutomaterializationContent = () => {

return (
<>
<Box padding={{vertical: 12, horizontal: 24}} flex={{direction: 'column', gap: 12}}>
<Alert
intent="info"
title="[Experimental] Dagster can automatically materialize assets when criteria are met."
description={
<>
Auto-materialization enables a declarative approach to asset scheduling – instead of
defining imperative workflows to materialize your assets, you just describe the
conditions under which they should be materialized.{' '}
<a
href="https://docs.dagster.io/concepts/assets/asset-auto-execution"
target="_blank"
rel="noreferrer"
>
Learn more about auto-materialization here
</a>
.
</>
}
/>
<Box padding={{vertical: 12, horizontal: 24}}>
<DeclarativeAutomationBanner />
</Box>
<Table>
<tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {useConfirmation} from '../app/CustomConfirmationProvider';
import {useUnscopedPermissions} from '../app/Permissions';
import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorFragment';
import {Timestamp} from '../app/time/Timestamp';
import {AutoMaterializeExperimentalTag} from '../assets/AutoMaterializePolicyPage/AutoMaterializeExperimentalBanner';
import {useAutoMaterializeSensorFlag} from '../assets/AutoMaterializeSensorFlag';
import {useAutomaterializeDaemonStatus} from '../assets/useAutomaterializeDaemonStatus';
import {testId} from '../testing/testId';
Expand Down Expand Up @@ -65,19 +64,19 @@ export const DaemonList = ({daemonStatuses, showTimestampColumn = true}: Props)
</tr>
</thead>
<tbody>
{assetDaemon ? (
{assetDaemon && hasGlobalAMP ? (
<tr>
<td>
<Box flex={{direction: 'row', justifyContent: 'space-between'}}>
<Box flex={{gap: 8, alignItems: 'center'}}>
Auto-materializing
<AutoMaterializeExperimentalTag />
<Tag intent="primary">Experimental</Tag>
</Box>
{automaterialize.loading ? (
<div data-testid={testId('loading-spinner')}>
<Spinner purpose="body-text" />
</div>
) : hasGlobalAMP ? (
) : (
<Checkbox
format="switch"
checked={!automaterialize.paused}
Expand All @@ -94,7 +93,7 @@ export const DaemonList = ({daemonStatuses, showTimestampColumn = true}: Props)
automaterialize.setPaused(!checked);
}}
/>
) : null}
)}
</Box>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useLazyQuery} from '@apollo/client';
import {Alert, Box, Colors, Spinner, Subtitle2} from '@dagster-io/ui-components';
import {Box, Colors, Spinner, Subtitle2} from '@dagster-io/ui-components';
import {useCallback, useMemo, useState} from 'react';

import {ASSET_SENSOR_TICKS_QUERY} from './AssetSensorTicksQuery';
Expand All @@ -12,6 +12,7 @@ import {SensorFragment} from './types/SensorFragment.types';
import {useRefreshAtInterval} from '../app/QueryRefresh';
import {AutomaterializationTickDetailDialog} from '../assets/auto-materialization/AutomaterializationTickDetailDialog';
import {AutomaterializeRunHistoryTable} from '../assets/auto-materialization/AutomaterializeRunHistoryTable';
import {DeclarativeAutomationBanner} from '../assets/auto-materialization/DeclarativeAutomationBanner';
import {SensorAutomaterializationEvaluationHistoryTable} from '../assets/auto-materialization/SensorAutomaterializationEvaluationHistoryTable';
import {AssetDaemonTickFragment} from '../assets/auto-materialization/types/AssetDaemonTicksQuery.types';
import {InstigationTickStatus} from '../graphql/types';
Expand Down Expand Up @@ -151,26 +152,8 @@ export const SensorPageAutomaterialize = (props: Props) => {

return (
<>
<Box padding={{vertical: 12, horizontal: 24}} flex={{direction: 'column', gap: 12}}>
<Alert
intent="info"
title="[Experimental] Dagster can automatically materialize assets when criteria are met."
description={
<>
Auto-materialization enables a declarative approach to asset scheduling – instead of
defining imperative workflows to materialize your assets, you just describe the
conditions under which they should be materialized.{' '}
<a
href="https://docs.dagster.io/concepts/assets/asset-auto-execution"
target="_blank"
rel="noreferrer"
>
Learn more about auto-materialization here
</a>
.
</>
}
/>
<Box padding={{vertical: 12, horizontal: 24}}>
<DeclarativeAutomationBanner />
</Box>
<SensorInfo assetDaemonHealth={daemonStatus} padding={{vertical: 16, horizontal: 24}} />
<Box padding={{vertical: 12, horizontal: 24}} border="bottom">
Expand Down

1 comment on commit 3d11bf1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-l06phiu45-elementl.vercel.app

Built with commit 3d11bf1.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.