Maksym Domariev
07/29/2022, 5:04 AMowen
07/29/2022, 11:59 PM@graph
def my_graph():
# some code
will function identically to
@job
def my_job():
# some code
So dynamic outputs will work with the @graph annotation in the same way as in the @job examplesMaksym Domariev
07/30/2022, 12:05 AMowen
07/30/2022, 12:08 AM@graph(out={"pages": GraphOut()})
def load_threads_graph(timeline):
return load_threads(timeline).collect()
with
@graph
def load_threads_graph(timeline):
return load_threads(timeline).collect()
I think your original example would work
(see thread below for an explanation)Maksym Domariev
07/30/2022, 5:31 AM@graph
def load_threads_graph(timeline):
return load_threads(timeline).collect()gives me the same error
owen
08/01/2022, 9:48 PM.collect()
call. I filed an issue here: https://github.com/dagster-io/dagster/issues/9139. If you're not doing anything with the output once you call collect(), there's actually no need to make the call (collect() just will bundle all the outputs into a list that you can pass into a downstream op), so you could consider just not returning anything from your graph, i.e.
@graph
def load_threads_graph(timeline):
load_threads(timeline)