Skip to content

How to implement multiple production pathways for a single asset #23705

Answered by garethbrickman
lukastk asked this question in Q&A
Discussion options

You must be logged in to vote

Both upstream assets would have to materialize successfully for this structure to work. You can't materialize one upstream asset and not the other if they are both inputs or dependencies for a downstream asset.

Depending on your use case, you could consider other approaches such as using graph-backed assets or using multi-asset with a resource as in this example:

from dagster import resource, multi_asset, AssetOut, Output, Definitions, OpExecutionContext

@resource
def my_resource():
    def my_method():
        return "shared_value_from_my_resource"
    return my_method

@multi_asset(
    outs={
        "asset_1": AssetOut(is_required=False),
        "asset_2": AssetOut(is_required=False)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lukastk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: asset Related to Software-Defined Assets
2 participants