https://dagster.io/ logo
#ask-community
Title
# ask-community
v

Vinnie

08/23/2022, 2:15 PM
I have a job composed of two “ops”: a
multi_asset
that yields optional outputs; and their downstream dbt models, created with
define_asset_job(selection=AssetSelection.keys().downstream())
. If not all assets from the
multi_asset
are materialized by the pipeline/first op, execution of downstream ops (dbt models) doesn’t seem to run, returning a log message
Skipping step <dbt_op> due to skipped dependencies: [].
Works fine and materializes everything as expected if all assets are yielded. Anything I’m missing?
For more context. here’s a minimal implementation of my
multi_asset
logic
Copy code
@multi_asset(
    outs={
        "asset1": AssetOut(
            key_prefix="some_prefix",
            is_required=False,
        ),
        "asset2": AssetOut(
            key_prefix="some_prefix",
            is_required=False,
        ),
    },
    can_subset=True,
    group_name="my_cool_group",
)
def my_assets(context):
    elems = fetch()
    for elem in elems:
        if elem["dest_asset"] in context.selected_output_names:
            processed_elem = process(elem)
            yield Output(value=processed_elem["data"], output_name=elem["dest_asset"])
c

chris

08/24/2022, 4:59 PM
How exactly are you declaring the dependency between the multi asset and the dbt models? It looks like there's some conditional branching happening here, but the fact that the dependency list is empty is concerning
v

Vinnie

08/24/2022, 5:34 PM
Hi Chris, I’ll PM you some more info, can’t talk much more publicly
c

chris

08/24/2022, 7:18 PM
Okay so this is a known issue https://github.com/dagster-io/dagster/issues/9408 and represents a feature gap in dagster unfortunately. Basically, assets require all of their inputs to be resolved in order to run, and causes the dbt asset (which contains multiple models) to not run if only some inputs are provided.
As a workaround - I think what you can do is split up your call of
load_assets_from_dbt_project
so that there are two different software artifacts constructed
Let me know if that makes sense, or if you need guidance on doing that.
v

Vinnie

08/24/2022, 7:23 PM
Should be easy enough, I’ll try tomorrow and ping the thread :)
c

chris

08/24/2022, 7:30 PM
Sounds good!
72 Views