Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Dagster UI copy for external assets; add example to toys #17086

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const DescriptionAnnotations: React.FC<{
{assetNode.isSource ? (
<Caption style={{lineHeight: '16px'}}>Source Asset</Caption>
) : !assetNode.isExecutable ? (
<Caption style={{lineHeight: '16px'}}>Non-executable Asset</Caption>
<Caption style={{lineHeight: '16px'}}>External Asset</Caption>
) : undefined}
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function executionDisabledMessageForAssets(
: assets.every((a) => a.isSource)
? 'Source assets cannot be materialized'
: assets.every((a) => !a.isExecutable)
? 'Non-executable assets cannot be materialized'
? 'External assets cannot be materialized'
: null;
}

Expand Down Expand Up @@ -412,7 +412,7 @@ async function stateForLaunchingAssets(
if (assets.some((x) => !x.isExecutable)) {
return {
type: 'error',
error: 'One or more non-executable assets are selected.',
error: 'One or more external assets are selected.',
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('LaunchAssetExecutionButton', () => {
expect(button).toBeDisabled();

userEvent.hover(button);
expect(await screen.findByText('Non-executable assets cannot be materialized')).toBeDefined();
expect(await screen.findByText('External assets cannot be materialized')).toBeDefined();
});
});

Expand Down
26 changes: 26 additions & 0 deletions python_modules/dagster-test/dagster_test/toys/external_assets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from dagster import AssetMaterialization, AssetSpec, Definitions, OpExecutionContext, job, op
from dagster._core.definitions.external_asset import external_assets_from_specs

asset_one = AssetSpec("asset_one")

asset_two = AssetSpec("asset_two", deps=[asset_one])


@op
def insert_materializations(context: OpExecutionContext) -> None:
context.log_event(
AssetMaterialization(asset_one.key, metadata={"nrows": 10, "source": "From this script."})
)
context.log_event(
AssetMaterialization(asset_two.key, metadata={"nrows": 12, "source": "From this script."})
)


@job
def insert_materializations_job() -> None:
insert_materializations()


defs = Definitions(
assets=external_assets_from_specs([asset_one, asset_two]), jobs=[insert_materializations_job]
)