diff --git a/python_modules/dagster/dagster/_core/execution/plan/execute_step.py b/python_modules/dagster/dagster/_core/execution/plan/execute_step.py index caaeb6e6a0a6f..74d4ae030c2b1 100644 --- a/python_modules/dagster/dagster/_core/execution/plan/execute_step.py +++ b/python_modules/dagster/dagster/_core/execution/plan/execute_step.py @@ -779,10 +779,14 @@ def _gen_fn(): yield DagsterEvent.asset_materialization(step_context, materialization) asset_key, partitions = _asset_key_and_partitions_for_output(output_context) - asset_layer = step_context.job_def.asset_layer - if asset_key and asset_layer.has_assets_def_for_asset(asset_key): - assets_def = asset_layer.assets_def_for_asset(asset_key) - execution_type = assets_def.asset_execution_type_for_asset(asset_key) + if asset_key: + asset_layer = step_context.job_def.asset_layer + execution_type = ( + asset_layer.assets_def_for_asset(asset_key).asset_execution_type_for_asset(asset_key) + if asset_layer.has_assets_def_for_asset(asset_key) + else AssetExecutionType.MATERIALIZATION + ) + check.invariant( execution_type != AssetExecutionType.UNEXECUTABLE, "There should never be unexecutable assets here",