Skip to content

Commit

Permalink
[dagster-dbt][refactor] Use AssetOut.from_spec() to create AssetOuts …
Browse files Browse the repository at this point in the history
…for dbt_assets decorator
  • Loading branch information
OwenKephart committed Dec 20, 2024
1 parent 234e10c commit 03c57d7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions python_modules/libraries/dagster-dbt/dagster_dbt/asset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
AssetOut,
AssetsDefinition,
AssetSelection,
AssetSpec,
AutoMaterializePolicy,
AutomationCondition,
DagsterInvalidDefinitionError,
Expand Down Expand Up @@ -807,12 +808,9 @@ def build_dbt_multi_asset_args(
project=project,
)

outs[output_name] = AssetOut(
spec = AssetSpec(
key=asset_key,
dagster_type=Nothing,
io_manager_key=io_manager_key,
description=dagster_dbt_translator.get_description(dbt_resource_props),
is_required=False,
metadata=metadata,
owners=dagster_dbt_translator.get_owners(
{
Expand All @@ -832,6 +830,14 @@ def build_dbt_multi_asset_args(
dbt_resource_props
),
)
if io_manager_key:
spec = spec.with_io_manager_key(io_manager_key)

outs[output_name] = AssetOut.from_spec(
spec=spec,
dagster_type=Nothing,
is_required=False,
)

test_unique_ids = [
child_unique_id
Expand Down

0 comments on commit 03c57d7

Please sign in to comment.