https://dagster.io/ logo
Title
o

Oliver

10/25/2022, 1:29 AM
hey all, how can we added non argument deps for assets produced using
AssetsDefinition.from_graph
?
j

jamie

10/25/2022, 2:19 PM
I think you might be able to have the inputs as
Nothing
in your graph and then map the asset key to that input in the
keys_by_input_name
argument to
from_graph
. something like this might work
@asset 
def asset_a():
    return 1

@graph(
   ins={"asset_a": In(Nothing)
)
def my_graph():
    # do something 

my_graph_asset = AssetsDefinition.from_graph(keys_by_input_name={"asset_a": AssetKey("asset_a")})
@claire does this seem right?
c

claire

10/25/2022, 4:26 PM
really close--it's the op that has to have a nothing input. Because dagster flattens all graphs into a mapping of ops and their dependencies, any input passed into a graph must be passed into an op. There's an example here in this github discussion: https://github.com/dagster-io/dagster/discussions/10029
:ty-spinny: 2
o

Oliver

10/25/2022, 10:16 PM
awesome, thanks both 🙂
:rainbow-daggy: 1