When chaining Ops together in a job, are there any...
# ask-community
b
When chaining Ops together in a job, are there any special requirements to being able to use syntax like
my_op_two(my_op_one())
? I was just trying to use the below code but getting this error:
dagster._core.errors.DagsterInvalidDefinitionError: In @job create_database_clones, received too many inputs for invocation create_database_clones_op. Only 0 defined, received 1
The only way I got this to work was by adding
ins={"start": In(Nothing)}
into the decorator on
create_database_clones_op()
z
So even if you don't explicitly return something in python, None still gets returned from a function call. So When you do
Copy code
create_database_clones_op(drop_database_clones_op())
drop_database_clones_op
is passing a None into the
create_database_clones_op
. But
create_database_clones_op
doesn't expect any parameters, which is why you get the error with
Only 0 defined, received 1
. So if you don't expect any outputs to be passed from one op into another op, you have to do the
ins={"start": In(Nothing)}
, which is how you indicate to Dagster that no data should be passed
b
ah perfect — thanks for the simple explanation!
🎉 1