https://dagster.io/ logo
#dagster-support
Title
# dagster-support
s

Slackbot

09/12/2022, 2:31 PM
This message was deleted.
s

sean

09/14/2022, 8:29 PM
Hi Heber, currently the only way to mix assets and ops is to wrap ops inside a graph-backed asset. Whether you want to do this sort of depends on the other stuff going into your job-- if you’re just using assets, then you should just build an asset graph like this:
Copy code
from dagster import AssetOut, asset, multi_asset, define_asset_job, repository


@asset
def foo():
    return [1, 2, 3]


@multi_asset(
    outs={
        "user": AssetOut(),
        "pwd": AssetOut(),
    }
)
def credentials(foo):
	# ...
    return user, password

@asset
def bar(user):
    return "bar"

@asset
def baz(pwd):
    return "baz"



all_assets_job = define_asset_job(name="all_assets_job")


@repository
def repo():
    return [
        foo, 
        bar, 
        baz, 
        credentials, 
        all_assets_job
    ]
But also, you might want to consider setting your credentials with config instead of a
multi_asset