Hi! Couldn’t find how to do this in the documentat...
# ask-community
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
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
Yeah, this is the error that I get. AKA it does not like
being an input if it did not come from the output of another function.
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
Thanks a lot! This is what I was looking for indeed.