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

Thomas

12/14/2022, 1:30 PM
Hi! Couldn’t find how to do this in the documentation. Is there any way to do something like this?
dagster bot responded by community 1
d

Daniel Gafni

12/14/2022, 1:44 PM
I think you just have to add an alias:
Copy code
addition(i, i).alias(f"addition_{i}")
but I'm not sure. Does this fail with an error for you? or what's the problem? Edit: seems like by default Dagster already does an alias Edit2: I was wrong, it's not related
t

Thomas

12/14/2022, 3:29 PM
Yeah, this is the error that I get. AKA it does not like
i
being an input if it did not come from the output of another function.
z

Zach

12/14/2022, 10:52 PM
there's two things going on here - you can't pass values directly into an op from within a job or graph - in general the only things you do in a graph / job is define the dependencies between ops. you'd have to pass it in via run config if the input isn't being generated from another op (these are called unconnected inputs. something like
Copy code
execute.execute_in_process(run_config={"ops": {"addition":{"inputs":{"a": 1, "b": 2}}}})
the other issue is that it seems like you're really trying to make a dynamic graph. so in this specific example you'd want to have one op that takes the number of iterations either as an input or a config schema field and yields the appropriate number of DynamicOutputs, and another op that does the execution. you might also want to read up on op configuration for managing the parameterization of your ops
🌈 1
t

Thomas

12/21/2022, 12:46 PM
Thanks a lot! This is what I was looking for indeed.