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

Sara

04/20/2022, 7:13 AM
Good afternoon, Is there any way to control the synchronies? I run several functions within an graph and I have the problem that it does not wait for one to finish before starting the other. Any solution? Thanks! Example: @graph def do_some_task(): function1() -- (can be an external function, op or another graph) function2() -- (can be an external function, op or another graph) * Dagster starts to perform function2 before function1 has finished.
s

Sanidhya Singh

04/20/2022, 7:18 AM
Copy code
@graph
def do_some_task():
    function2(function1())
s

Sara

04/20/2022, 7:42 AM
Thank you @Sanidhya Singh! It looks good what you are telling me. For that I would need to have an optional ipunt in the @graph. would you know how to set it? Thanks!!!
s

Sanidhya Singh

04/20/2022, 12:08 PM
Copy code
@op(out={"success": Out(bool)})
def function1(context):
    ------
    ------
    return True
you can try something like this to define your ops
❤️ 1
s

Sara

04/25/2022, 7:05 AM
Hi, @johann!! I am using a graph and I get this error: @graph 'dagster_test2' has unmapped input 'ins'. Remove it or pass it to the appropriate solid invocation.
s

Sanidhya Singh

04/25/2022, 7:06 AM
if you’re not passing any input you can just do
ins={}
in your definition
s

Sara

04/25/2022, 8:26 AM
How @Sanidhya Singh? I don't understand 😞 My code: @graph def dagster_test1(ins={"start": In(Nothing)}): retval = start_graph1() retval1 = dagster_op(dagster_get_op1_params(), retval) retval2 = dagster_op(dagster_get_op2_params(), retval1) end_graph1(retval2) return retval2 @graph def dagster_test2(ins={"start": In(Nothing)}): retval = start_graph2() retval1 = dagster_op(dagster_get_op1_params(), retval) retval2 = dagster_op(dagster_get_op2_params(), retval1) end_graph2(retval2) return retval2 @job def dagster_test(): dagster_test2(dagster_test1()) if name == "__main__": result = dagster_test.execute_in_process()
s

Sanidhya Singh

04/25/2022, 9:48 AM
I think you should look at nesting Graphs https://docs.dagster.io/concepts/ops-jobs-graphs/nesting-graphs
❤️ 1
8 Views